root / configure @ 3f534581
History | View | Annotate | Download (91.8 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 | a91b857c | malc | TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe" |
17 | 7d13299d | bellard | |
18 | 0ba8681e | Loïc Minier | # NB: do not call "exit" in the trap handler; this is buggy with some shells; |
19 | 0ba8681e | Loïc Minier | # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org> |
20 | 0ba8681e | Loïc Minier | trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM |
21 | da1d85e3 | Gerd Hoffmann | rm -f config.log |
22 | 9ac81bbb | malc | |
23 | 52166aa0 | Juan Quintela | compile_object() { |
24 | da1d85e3 | Gerd Hoffmann | echo $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log |
25 | da1d85e3 | Gerd Hoffmann | $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log 2>&1 |
26 | 52166aa0 | Juan Quintela | } |
27 | 52166aa0 | Juan Quintela | |
28 | 52166aa0 | Juan Quintela | compile_prog() { |
29 | 52166aa0 | Juan Quintela | local_cflags="$1" |
30 | 52166aa0 | Juan Quintela | local_ldflags="$2" |
31 | da1d85e3 | Gerd Hoffmann | echo $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log |
32 | da1d85e3 | Gerd Hoffmann | $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log 2>&1 |
33 | 52166aa0 | Juan Quintela | } |
34 | 52166aa0 | Juan Quintela | |
35 | 11568d6d | Paolo Bonzini | # symbolically link $1 to $2. Portable version of "ln -sf". |
36 | 11568d6d | Paolo Bonzini | symlink() { |
37 | 11568d6d | Paolo Bonzini | rm -f $2 |
38 | 11568d6d | Paolo Bonzini | ln -s $1 $2 |
39 | 11568d6d | Paolo Bonzini | } |
40 | 11568d6d | Paolo Bonzini | |
41 | 0dba6195 | Loïc Minier | # check whether a command is available to this shell (may be either an |
42 | 0dba6195 | Loïc Minier | # executable or a builtin) |
43 | 0dba6195 | Loïc Minier | has() { |
44 | 0dba6195 | Loïc Minier | type "$1" >/dev/null 2>&1 |
45 | 0dba6195 | Loïc Minier | } |
46 | 0dba6195 | Loïc Minier | |
47 | 0dba6195 | Loïc Minier | # search for an executable in PATH |
48 | 0dba6195 | Loïc Minier | path_of() { |
49 | 0dba6195 | Loïc Minier | local_command="$1" |
50 | 0dba6195 | Loïc Minier | local_ifs="$IFS" |
51 | 0dba6195 | Loïc Minier | local_dir="" |
52 | 0dba6195 | Loïc Minier | |
53 | 0dba6195 | Loïc Minier | # pathname has a dir component? |
54 | 0dba6195 | Loïc Minier | if [ "${local_command#*/}" != "$local_command" ]; then |
55 | 0dba6195 | Loïc Minier | if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then |
56 | 0dba6195 | Loïc Minier | echo "$local_command" |
57 | 0dba6195 | Loïc Minier | return 0 |
58 | 0dba6195 | Loïc Minier | fi |
59 | 0dba6195 | Loïc Minier | fi |
60 | 0dba6195 | Loïc Minier | if [ -z "$local_command" ]; then |
61 | 0dba6195 | Loïc Minier | return 1 |
62 | 0dba6195 | Loïc Minier | fi |
63 | 0dba6195 | Loïc Minier | |
64 | 0dba6195 | Loïc Minier | IFS=: |
65 | 0dba6195 | Loïc Minier | for local_dir in $PATH; do |
66 | 0dba6195 | Loïc Minier | if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then |
67 | 0dba6195 | Loïc Minier | echo "$local_dir/$local_command" |
68 | 0dba6195 | Loïc Minier | IFS="${local_ifs:-$(printf ' \t\n')}" |
69 | 0dba6195 | Loïc Minier | return 0 |
70 | 0dba6195 | Loïc Minier | fi |
71 | 0dba6195 | Loïc Minier | done |
72 | 0dba6195 | Loïc Minier | # not found |
73 | 0dba6195 | Loïc Minier | IFS="${local_ifs:-$(printf ' \t\n')}" |
74 | 0dba6195 | Loïc Minier | return 1 |
75 | 0dba6195 | Loïc Minier | } |
76 | 0dba6195 | Loïc Minier | |
77 | 7d13299d | bellard | # default parameters |
78 | ca4deeb1 | Paolo Bonzini | source_path=`dirname "$0"` |
79 | 2ff6b91e | Juan Quintela | cpu="" |
80 | 1e43adfc | bellard | interp_prefix="/usr/gnemul/qemu-%M" |
81 | 43ce4dfe | bellard | static="no" |
82 | ed968ff1 | Juan Quintela | sparc_cpu="" |
83 | 7d13299d | bellard | cross_prefix="" |
84 | 0c58ac1c | malc | audio_drv_list="" |
85 | d61a4ce8 | Gerd Hoffmann | audio_card_list="ac97 es1370 sb16 hda" |
86 | d61a4ce8 | Gerd Hoffmann | audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda" |
87 | eb852011 | Markus Armbruster | block_drv_whitelist="" |
88 | 7d13299d | bellard | host_cc="gcc" |
89 | c81da56e | Juan Quintela | helper_cflags="" |
90 | 73da375e | Juan Quintela | libs_softmmu="" |
91 | 3e2e0e6b | Juan Quintela | libs_tools="" |
92 | 67f86e8e | Juan Quintela | audio_pt_int="" |
93 | d5631638 | malc | audio_win_int="" |
94 | 2b2e59e6 | Paolo Bonzini | cc_i386=i386-pc-linux-gnu-gcc |
95 | 957f1f99 | Michael Roth | libs_qga="" |
96 | ac0df51d | aliguori | |
97 | 377529c0 | Paolo Bonzini | target_list="" |
98 | 377529c0 | Paolo Bonzini | |
99 | 377529c0 | Paolo Bonzini | # Default value for a variable defining feature "foo". |
100 | 377529c0 | Paolo Bonzini | # * foo="no" feature will only be used if --enable-foo arg is given |
101 | 377529c0 | Paolo Bonzini | # * foo="" feature will be searched for, and if found, will be used |
102 | 377529c0 | Paolo Bonzini | # unless --disable-foo is given |
103 | 377529c0 | Paolo Bonzini | # * foo="yes" this value will only be set by --enable-foo flag. |
104 | 377529c0 | Paolo Bonzini | # feature will searched for, |
105 | 377529c0 | Paolo Bonzini | # if not found, configure exits with error |
106 | 377529c0 | Paolo Bonzini | # |
107 | 377529c0 | Paolo Bonzini | # Always add --enable-foo and --disable-foo command line args. |
108 | 377529c0 | Paolo Bonzini | # Distributions want to ensure that several features are compiled in, and it |
109 | 377529c0 | Paolo Bonzini | # is impossible without a --enable-foo that exits if a feature is not found. |
110 | 377529c0 | Paolo Bonzini | |
111 | 377529c0 | Paolo Bonzini | bluez="" |
112 | 377529c0 | Paolo Bonzini | brlapi="" |
113 | 377529c0 | Paolo Bonzini | curl="" |
114 | 377529c0 | Paolo Bonzini | curses="" |
115 | 377529c0 | Paolo Bonzini | docs="" |
116 | 377529c0 | Paolo Bonzini | fdt="" |
117 | 377529c0 | Paolo Bonzini | nptl="" |
118 | 377529c0 | Paolo Bonzini | sdl="" |
119 | 821601ea | Jes Sorensen | vnc="yes" |
120 | 377529c0 | Paolo Bonzini | sparse="no" |
121 | 377529c0 | Paolo Bonzini | uuid="" |
122 | 377529c0 | Paolo Bonzini | vde="" |
123 | 377529c0 | Paolo Bonzini | vnc_tls="" |
124 | 377529c0 | Paolo Bonzini | vnc_sasl="" |
125 | 377529c0 | Paolo Bonzini | vnc_jpeg="" |
126 | 377529c0 | Paolo Bonzini | vnc_png="" |
127 | 377529c0 | Paolo Bonzini | vnc_thread="no" |
128 | 377529c0 | Paolo Bonzini | xen="" |
129 | d5b93ddf | Anthony PERARD | xen_ctrl_version="" |
130 | 377529c0 | Paolo Bonzini | linux_aio="" |
131 | 377529c0 | Paolo Bonzini | attr="" |
132 | 377529c0 | Paolo Bonzini | xfs="" |
133 | 377529c0 | Paolo Bonzini | |
134 | d41a75a2 | Brad | vhost_net="no" |
135 | d41a75a2 | Brad | kvm="no" |
136 | 377529c0 | Paolo Bonzini | gprof="no" |
137 | 377529c0 | Paolo Bonzini | debug_tcg="no" |
138 | 377529c0 | Paolo Bonzini | debug_mon="no" |
139 | 377529c0 | Paolo Bonzini | debug="no" |
140 | 377529c0 | Paolo Bonzini | strip_opt="yes" |
141 | 377529c0 | Paolo Bonzini | bigendian="no" |
142 | 377529c0 | Paolo Bonzini | mingw32="no" |
143 | 377529c0 | Paolo Bonzini | EXESUF="" |
144 | 377529c0 | Paolo Bonzini | prefix="/usr/local" |
145 | 377529c0 | Paolo Bonzini | mandir="\${prefix}/share/man" |
146 | 377529c0 | Paolo Bonzini | datadir="\${prefix}/share/qemu" |
147 | 377529c0 | Paolo Bonzini | docdir="\${prefix}/share/doc/qemu" |
148 | 377529c0 | Paolo Bonzini | bindir="\${prefix}/bin" |
149 | 3aa5d2be | Alon Levy | libdir="\${prefix}/lib" |
150 | 0f94d6da | Alon Levy | includedir="\${prefix}/include" |
151 | 377529c0 | Paolo Bonzini | sysconfdir="\${prefix}/etc" |
152 | 377529c0 | Paolo Bonzini | confsuffix="/qemu" |
153 | 377529c0 | Paolo Bonzini | slirp="yes" |
154 | 377529c0 | Paolo Bonzini | fmod_lib="" |
155 | 377529c0 | Paolo Bonzini | fmod_inc="" |
156 | 377529c0 | Paolo Bonzini | oss_lib="" |
157 | 377529c0 | Paolo Bonzini | bsd="no" |
158 | 377529c0 | Paolo Bonzini | linux="no" |
159 | 377529c0 | Paolo Bonzini | solaris="no" |
160 | 377529c0 | Paolo Bonzini | profiler="no" |
161 | 377529c0 | Paolo Bonzini | cocoa="no" |
162 | 377529c0 | Paolo Bonzini | softmmu="yes" |
163 | 377529c0 | Paolo Bonzini | linux_user="no" |
164 | 377529c0 | Paolo Bonzini | darwin_user="no" |
165 | 377529c0 | Paolo Bonzini | bsd_user="no" |
166 | 377529c0 | Paolo Bonzini | guest_base="" |
167 | 377529c0 | Paolo Bonzini | uname_release="" |
168 | 377529c0 | Paolo Bonzini | io_thread="no" |
169 | 377529c0 | Paolo Bonzini | mixemu="no" |
170 | 377529c0 | Paolo Bonzini | aix="no" |
171 | 377529c0 | Paolo Bonzini | blobs="yes" |
172 | 377529c0 | Paolo Bonzini | pkgversion="" |
173 | 377529c0 | Paolo Bonzini | check_utests="no" |
174 | 377529c0 | Paolo Bonzini | user_pie="no" |
175 | 377529c0 | Paolo Bonzini | zero_malloc="" |
176 | 377529c0 | Paolo Bonzini | trace_backend="nop" |
177 | 377529c0 | Paolo Bonzini | trace_file="trace" |
178 | 377529c0 | Paolo Bonzini | spice="" |
179 | 377529c0 | Paolo Bonzini | rbd="" |
180 | 36707144 | Alon Levy | smartcard="" |
181 | 111a38b0 | Robert Relyea | smartcard_nss="" |
182 | 69354a83 | Hans de Goede | usb_redir="" |
183 | 430a3c18 | Michael Walle | opengl="" |
184 | 1ece9905 | Alon Levy | zlib="yes" |
185 | d138cee9 | Michael Roth | guest_agent="yes" |
186 | 377529c0 | Paolo Bonzini | |
187 | ac0df51d | aliguori | # parse CC options first |
188 | ac0df51d | aliguori | for opt do |
189 | ac0df51d | aliguori | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
190 | ac0df51d | aliguori | case "$opt" in |
191 | ac0df51d | aliguori | --cross-prefix=*) cross_prefix="$optarg" |
192 | ac0df51d | aliguori | ;; |
193 | 3d8df640 | Paolo Bonzini | --cc=*) CC="$optarg" |
194 | ac0df51d | aliguori | ;; |
195 | ca4deeb1 | Paolo Bonzini | --source-path=*) source_path="$optarg" |
196 | ca4deeb1 | Paolo Bonzini | ;; |
197 | 2ff6b91e | Juan Quintela | --cpu=*) cpu="$optarg" |
198 | 2ff6b91e | Juan Quintela | ;; |
199 | a558ee17 | Juan Quintela | --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" |
200 | e2a2ed06 | Juan Quintela | ;; |
201 | e2a2ed06 | Juan Quintela | --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" |
202 | e2a2ed06 | Juan Quintela | ;; |
203 | 50e7b1a0 | Juan Quintela | --sparc_cpu=*) |
204 | 50e7b1a0 | Juan Quintela | sparc_cpu="$optarg" |
205 | 50e7b1a0 | Juan Quintela | case $sparc_cpu in |
206 | ed968ff1 | Juan Quintela | v7|v8|v8plus|v8plusa) |
207 | 50e7b1a0 | Juan Quintela | cpu="sparc" |
208 | 50e7b1a0 | Juan Quintela | ;; |
209 | 50e7b1a0 | Juan Quintela | v9) |
210 | 50e7b1a0 | Juan Quintela | cpu="sparc64" |
211 | 50e7b1a0 | Juan Quintela | ;; |
212 | 50e7b1a0 | Juan Quintela | *) |
213 | 50e7b1a0 | Juan Quintela | echo "undefined SPARC architecture. Exiting"; |
214 | 50e7b1a0 | Juan Quintela | exit 1 |
215 | 50e7b1a0 | Juan Quintela | ;; |
216 | 50e7b1a0 | Juan Quintela | esac |
217 | 50e7b1a0 | Juan Quintela | ;; |
218 | ac0df51d | aliguori | esac |
219 | ac0df51d | aliguori | done |
220 | ac0df51d | aliguori | # OS specific |
221 | ac0df51d | aliguori | # Using uname is really, really broken. Once we have the right set of checks |
222 | ac0df51d | aliguori | # we can eliminate it's usage altogether |
223 | ac0df51d | aliguori | |
224 | b3198cc2 | Stuart Yoder | cc="${CC-${cross_prefix}gcc}" |
225 | b3198cc2 | Stuart Yoder | ar="${AR-${cross_prefix}ar}" |
226 | b3198cc2 | Stuart Yoder | objcopy="${OBJCOPY-${cross_prefix}objcopy}" |
227 | b3198cc2 | Stuart Yoder | ld="${LD-${cross_prefix}ld}" |
228 | 3f534581 | Brad | libtool="${LIBTOOL-${cross_prefix}libtool}" |
229 | b3198cc2 | Stuart Yoder | strip="${STRIP-${cross_prefix}strip}" |
230 | b3198cc2 | Stuart Yoder | windres="${WINDRES-${cross_prefix}windres}" |
231 | b3198cc2 | Stuart Yoder | pkg_config="${PKG_CONFIG-${cross_prefix}pkg-config}" |
232 | b3198cc2 | Stuart Yoder | sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" |
233 | ac0df51d | aliguori | |
234 | be17dc90 | Michael S. Tsirkin | # default flags for all hosts |
235 | be17dc90 | Michael S. Tsirkin | QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" |
236 | be17dc90 | Michael S. Tsirkin | CFLAGS="-g $CFLAGS" |
237 | f9188227 | Mike Frysinger | QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" |
238 | be17dc90 | Michael S. Tsirkin | QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" |
239 | be17dc90 | Michael S. Tsirkin | QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" |
240 | 84958305 | Kirill A. Shutemov | QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" |
241 | cbbab922 | Paolo Bonzini | QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu" |
242 | be17dc90 | Michael S. Tsirkin | LDFLAGS="-g $LDFLAGS" |
243 | be17dc90 | Michael S. Tsirkin | |
244 | ca4deeb1 | Paolo Bonzini | # make source path absolute |
245 | ca4deeb1 | Paolo Bonzini | source_path=`cd "$source_path"; pwd` |
246 | ca4deeb1 | Paolo Bonzini | |
247 | ac0df51d | aliguori | check_define() { |
248 | ac0df51d | aliguori | cat > $TMPC <<EOF |
249 | ac0df51d | aliguori | #if !defined($1) |
250 | ac0df51d | aliguori | #error Not defined |
251 | ac0df51d | aliguori | #endif |
252 | ac0df51d | aliguori | int main(void) { return 0; } |
253 | ac0df51d | aliguori | EOF |
254 | 52166aa0 | Juan Quintela | compile_object |
255 | ac0df51d | aliguori | } |
256 | ac0df51d | aliguori | |
257 | 2ff6b91e | Juan Quintela | if test ! -z "$cpu" ; then |
258 | 2ff6b91e | Juan Quintela | # command line argument |
259 | 2ff6b91e | Juan Quintela | : |
260 | 2ff6b91e | Juan Quintela | elif check_define __i386__ ; then |
261 | ac0df51d | aliguori | cpu="i386" |
262 | ac0df51d | aliguori | elif check_define __x86_64__ ; then |
263 | ac0df51d | aliguori | cpu="x86_64" |
264 | 3aa9bd6c | blueswir1 | elif check_define __sparc__ ; then |
265 | 3aa9bd6c | blueswir1 | # We can't check for 64 bit (when gcc is biarch) or V8PLUSA |
266 | 3aa9bd6c | blueswir1 | # They must be specified using --sparc_cpu |
267 | 3aa9bd6c | blueswir1 | if check_define __arch64__ ; then |
268 | 3aa9bd6c | blueswir1 | cpu="sparc64" |
269 | 3aa9bd6c | blueswir1 | else |
270 | 3aa9bd6c | blueswir1 | cpu="sparc" |
271 | 3aa9bd6c | blueswir1 | fi |
272 | fdf7ed96 | malc | elif check_define _ARCH_PPC ; then |
273 | fdf7ed96 | malc | if check_define _ARCH_PPC64 ; then |
274 | fdf7ed96 | malc | cpu="ppc64" |
275 | fdf7ed96 | malc | else |
276 | fdf7ed96 | malc | cpu="ppc" |
277 | fdf7ed96 | malc | fi |
278 | afa05235 | Aurelien Jarno | elif check_define __mips__ ; then |
279 | afa05235 | Aurelien Jarno | cpu="mips" |
280 | 477ba620 | Aurelien Jarno | elif check_define __ia64__ ; then |
281 | 477ba620 | Aurelien Jarno | cpu="ia64" |
282 | d66ed0ea | Aurelien Jarno | elif check_define __s390__ ; then |
283 | d66ed0ea | Aurelien Jarno | if check_define __s390x__ ; then |
284 | d66ed0ea | Aurelien Jarno | cpu="s390x" |
285 | d66ed0ea | Aurelien Jarno | else |
286 | d66ed0ea | Aurelien Jarno | cpu="s390" |
287 | d66ed0ea | Aurelien Jarno | fi |
288 | ac0df51d | aliguori | else |
289 | fdf7ed96 | malc | cpu=`uname -m` |
290 | ac0df51d | aliguori | fi |
291 | ac0df51d | aliguori | |
292 | 7d13299d | bellard | case "$cpu" in |
293 | d2fbca94 | Guan Xuetao | alpha|cris|ia64|lm32|m68k|microblaze|ppc|ppc64|sparc64|unicore32) |
294 | ea8f20f8 | Juan Quintela | cpu="$cpu" |
295 | ea8f20f8 | Juan Quintela | ;; |
296 | 7d13299d | bellard | i386|i486|i586|i686|i86pc|BePC) |
297 | 97a847bc | bellard | cpu="i386" |
298 | 7d13299d | bellard | ;; |
299 | aaa5fa14 | aurel32 | x86_64|amd64) |
300 | aaa5fa14 | aurel32 | cpu="x86_64" |
301 | aaa5fa14 | aurel32 | ;; |
302 | ba68055e | bellard | armv*b) |
303 | 808c4954 | bellard | cpu="armv4b" |
304 | 808c4954 | bellard | ;; |
305 | ba68055e | bellard | armv*l) |
306 | 7d13299d | bellard | cpu="armv4l" |
307 | 7d13299d | bellard | ;; |
308 | f54b3f92 | aurel32 | parisc|parisc64) |
309 | f54b3f92 | aurel32 | cpu="hppa" |
310 | f54b3f92 | aurel32 | ;; |
311 | afa05235 | Aurelien Jarno | mips*) |
312 | afa05235 | Aurelien Jarno | cpu="mips" |
313 | afa05235 | Aurelien Jarno | ;; |
314 | 24e804ec | Alexander Graf | s390) |
315 | fb3e5849 | bellard | cpu="s390" |
316 | fb3e5849 | bellard | ;; |
317 | 24e804ec | Alexander Graf | s390x) |
318 | 24e804ec | Alexander Graf | cpu="s390x" |
319 | 24e804ec | Alexander Graf | ;; |
320 | 3142255c | blueswir1 | sparc|sun4[cdmuv]) |
321 | ae228531 | bellard | cpu="sparc" |
322 | ae228531 | bellard | ;; |
323 | 7d13299d | bellard | *) |
324 | a447d4dc | Paolo Bonzini | echo "Unsupported CPU = $cpu" |
325 | a447d4dc | Paolo Bonzini | exit 1 |
326 | 7d13299d | bellard | ;; |
327 | 7d13299d | bellard | esac |
328 | e2d52ad3 | Juan Quintela | |
329 | 7d13299d | bellard | # OS specific |
330 | ac0df51d | aliguori | if check_define __linux__ ; then |
331 | ac0df51d | aliguori | targetos="Linux" |
332 | ac0df51d | aliguori | elif check_define _WIN32 ; then |
333 | ac0df51d | aliguori | targetos='MINGW32' |
334 | 169dc5d3 | blueswir1 | elif check_define __OpenBSD__ ; then |
335 | 169dc5d3 | blueswir1 | targetos='OpenBSD' |
336 | 169dc5d3 | blueswir1 | elif check_define __sun__ ; then |
337 | 169dc5d3 | blueswir1 | targetos='SunOS' |
338 | 179cf400 | Andreas Färber | elif check_define __HAIKU__ ; then |
339 | 179cf400 | Andreas Färber | targetos='Haiku' |
340 | ac0df51d | aliguori | else |
341 | ac0df51d | aliguori | targetos=`uname -s` |
342 | ac0df51d | aliguori | fi |
343 | 0dbfc675 | Juan Quintela | |
344 | 7d13299d | bellard | case $targetos in |
345 | c326e0af | bellard | CYGWIN*) |
346 | 0dbfc675 | Juan Quintela | mingw32="yes" |
347 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS" |
348 | d5631638 | malc | audio_possible_drivers="winwave sdl" |
349 | d5631638 | malc | audio_drv_list="winwave" |
350 | c326e0af | bellard | ;; |
351 | 67b915a5 | bellard | MINGW32*) |
352 | 0dbfc675 | Juan Quintela | mingw32="yes" |
353 | d5631638 | malc | audio_possible_drivers="winwave dsound sdl fmod" |
354 | d5631638 | malc | audio_drv_list="winwave" |
355 | 67b915a5 | bellard | ;; |
356 | 5c40d2bd | ths | GNU/kFreeBSD) |
357 | a167ba50 | Aurelien Jarno | bsd="yes" |
358 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
359 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd pa" |
360 | 5c40d2bd | ths | ;; |
361 | 7d3505c5 | bellard | FreeBSD) |
362 | 0dbfc675 | Juan Quintela | bsd="yes" |
363 | 0db4a067 | Paolo Bonzini | make="${MAKE-gmake}" |
364 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
365 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd pa" |
366 | f01576f1 | Juergen Lock | # needed for kinfo_getvmmap(3) in libutil.h |
367 | f01576f1 | Juergen Lock | LIBS="-lutil $LIBS" |
368 | 7d3505c5 | bellard | ;; |
369 | c5e97233 | blueswir1 | DragonFly) |
370 | 0dbfc675 | Juan Quintela | bsd="yes" |
371 | 0db4a067 | Paolo Bonzini | make="${MAKE-gmake}" |
372 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
373 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd pa" |
374 | c5e97233 | blueswir1 | ;; |
375 | 7d3505c5 | bellard | NetBSD) |
376 | 0dbfc675 | Juan Quintela | bsd="yes" |
377 | 0db4a067 | Paolo Bonzini | make="${MAKE-gmake}" |
378 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
379 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd" |
380 | 0dbfc675 | Juan Quintela | oss_lib="-lossaudio" |
381 | 7d3505c5 | bellard | ;; |
382 | 7d3505c5 | bellard | OpenBSD) |
383 | 0dbfc675 | Juan Quintela | bsd="yes" |
384 | 0db4a067 | Paolo Bonzini | make="${MAKE-gmake}" |
385 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
386 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd" |
387 | 0dbfc675 | Juan Quintela | oss_lib="-lossaudio" |
388 | 7d3505c5 | bellard | ;; |
389 | 83fb7adf | bellard | Darwin) |
390 | 0dbfc675 | Juan Quintela | bsd="yes" |
391 | 0dbfc675 | Juan Quintela | darwin="yes" |
392 | 0dbfc675 | Juan Quintela | # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can |
393 | 0dbfc675 | Juan Quintela | # run 64-bit userspace code |
394 | 0dbfc675 | Juan Quintela | if [ "$cpu" = "i386" ] ; then |
395 | aab8588a | malc | is_x86_64=`sysctl -n hw.optional.x86_64` |
396 | aab8588a | malc | [ "$is_x86_64" = "1" ] && cpu=x86_64 |
397 | 0dbfc675 | Juan Quintela | fi |
398 | 0dbfc675 | Juan Quintela | if [ "$cpu" = "x86_64" ] ; then |
399 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" |
400 | 0c439cbf | Juan Quintela | LDFLAGS="-arch x86_64 $LDFLAGS" |
401 | 0dbfc675 | Juan Quintela | else |
402 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS" |
403 | 0dbfc675 | Juan Quintela | fi |
404 | 0dbfc675 | Juan Quintela | darwin_user="yes" |
405 | 0dbfc675 | Juan Quintela | cocoa="yes" |
406 | 0dbfc675 | Juan Quintela | audio_drv_list="coreaudio" |
407 | 0dbfc675 | Juan Quintela | audio_possible_drivers="coreaudio sdl fmod" |
408 | 0dbfc675 | Juan Quintela | LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" |
409 | 7973f21c | Juan Quintela | libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" |
410 | 83fb7adf | bellard | ;; |
411 | ec530c81 | bellard | SunOS) |
412 | 0dbfc675 | Juan Quintela | solaris="yes" |
413 | 0db4a067 | Paolo Bonzini | make="${MAKE-gmake}" |
414 | 0db4a067 | Paolo Bonzini | install="${INSTALL-ginstall}" |
415 | fa58948d | Blue Swirl | ld="gld" |
416 | 0dbfc675 | Juan Quintela | needs_libsunmath="no" |
417 | 0dbfc675 | Juan Quintela | solarisrev=`uname -r | cut -f2 -d.` |
418 | 0dbfc675 | Juan Quintela | # have to select again, because `uname -m` returns i86pc |
419 | 0dbfc675 | Juan Quintela | # even on an x86_64 box. |
420 | 0dbfc675 | Juan Quintela | solariscpu=`isainfo -k` |
421 | 0dbfc675 | Juan Quintela | if test "${solariscpu}" = "amd64" ; then |
422 | 0dbfc675 | Juan Quintela | cpu="x86_64" |
423 | 0dbfc675 | Juan Quintela | fi |
424 | 0dbfc675 | Juan Quintela | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
425 | 0dbfc675 | Juan Quintela | if test "$solarisrev" -le 9 ; then |
426 | 0dbfc675 | Juan Quintela | if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then |
427 | 0dbfc675 | Juan Quintela | needs_libsunmath="yes" |
428 | f14bfdf9 | Juan Quintela | QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS" |
429 | f14bfdf9 | Juan Quintela | LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS" |
430 | f14bfdf9 | Juan Quintela | LIBS="-lsunmath $LIBS" |
431 | 0dbfc675 | Juan Quintela | else |
432 | 0dbfc675 | Juan Quintela | echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" |
433 | 0dbfc675 | Juan Quintela | echo "libsunmath from the Sun Studio compilers tools, due to a lack of" |
434 | 0dbfc675 | Juan Quintela | echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" |
435 | 0dbfc675 | Juan Quintela | echo "Studio 11 can be downloaded from www.sun.com." |
436 | 0dbfc675 | Juan Quintela | exit 1 |
437 | 0dbfc675 | Juan Quintela | fi |
438 | 86b2bd93 | ths | fi |
439 | 0dbfc675 | Juan Quintela | fi |
440 | 0dbfc675 | Juan Quintela | if test -f /usr/include/sys/soundcard.h ; then |
441 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
442 | 0dbfc675 | Juan Quintela | fi |
443 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl" |
444 | d741429a | Blue Swirl | # needed for CMSG_ macros in sys/socket.h |
445 | d741429a | Blue Swirl | QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" |
446 | d741429a | Blue Swirl | # needed for TIOCWIN* defines in termios.h |
447 | d741429a | Blue Swirl | QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" |
448 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" |
449 | e174c0bb | Juan Quintela | LIBS="-lsocket -lnsl -lresolv $LIBS" |
450 | 86b2bd93 | ths | ;; |
451 | b29fe3ed | malc | AIX) |
452 | 0dbfc675 | Juan Quintela | aix="yes" |
453 | 0db4a067 | Paolo Bonzini | make="${MAKE-gmake}" |
454 | b29fe3ed | malc | ;; |
455 | 179cf400 | Andreas Färber | Haiku) |
456 | 179cf400 | Andreas Färber | haiku="yes" |
457 | 179cf400 | Andreas Färber | QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" |
458 | 179cf400 | Andreas Färber | LIBS="-lposix_error_mapper -lnetwork $LIBS" |
459 | 179cf400 | Andreas Färber | ;; |
460 | 1d14ffa9 | bellard | *) |
461 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
462 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss alsa sdl esd pa" |
463 | 0dbfc675 | Juan Quintela | linux="yes" |
464 | 0dbfc675 | Juan Quintela | linux_user="yes" |
465 | 0dbfc675 | Juan Quintela | usb="linux" |
466 | af2be207 | Jan Kiszka | kvm="yes" |
467 | af2be207 | Jan Kiszka | vhost_net="yes" |
468 | 0dbfc675 | Juan Quintela | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
469 | c2de5c91 | malc | audio_possible_drivers="$audio_possible_drivers fmod" |
470 | 0dbfc675 | Juan Quintela | fi |
471 | fb065187 | bellard | ;; |
472 | 7d13299d | bellard | esac |
473 | 7d13299d | bellard | |
474 | 7d3505c5 | bellard | if [ "$bsd" = "yes" ] ; then |
475 | b1a550a0 | pbrook | if [ "$darwin" != "yes" ] ; then |
476 | 68063649 | blueswir1 | usb="bsd" |
477 | 83fb7adf | bellard | fi |
478 | 84778508 | blueswir1 | bsd_user="yes" |
479 | 7d3505c5 | bellard | fi |
480 | 7d3505c5 | bellard | |
481 | 0db4a067 | Paolo Bonzini | : ${make=${MAKE-make}} |
482 | 0db4a067 | Paolo Bonzini | : ${install=${INSTALL-install}} |
483 | c886edfb | Blue Swirl | : ${python=${PYTHON-python}} |
484 | 0db4a067 | Paolo Bonzini | |
485 | 3457a3f8 | Juan Quintela | if test "$mingw32" = "yes" ; then |
486 | 3457a3f8 | Juan Quintela | EXESUF=".exe" |
487 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" |
488 | e94a7936 | Stefan Weil | # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) |
489 | e94a7936 | Stefan Weil | QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" |
490 | 08f3896a | Stefan Weil | LIBS="-lwinmm -lws2_32 -liberty -liphlpapi $LIBS" |
491 | 683035de | Paolo Bonzini | prefix="c:/Program Files/Qemu" |
492 | 683035de | Paolo Bonzini | mandir="\${prefix}" |
493 | 683035de | Paolo Bonzini | datadir="\${prefix}" |
494 | 683035de | Paolo Bonzini | docdir="\${prefix}" |
495 | 683035de | Paolo Bonzini | bindir="\${prefix}" |
496 | 683035de | Paolo Bonzini | sysconfdir="\${prefix}" |
497 | 683035de | Paolo Bonzini | confsuffix="" |
498 | 83b2f0a0 | Stefan Weil | guest_agent="no" |
499 | 3457a3f8 | Juan Quintela | fi |
500 | 3457a3f8 | Juan Quintela | |
501 | 487fefdb | Anthony Liguori | werror="" |
502 | 85aa5189 | bellard | |
503 | 7d13299d | bellard | for opt do |
504 | a46e4035 | pbrook | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
505 | 7d13299d | bellard | case "$opt" in |
506 | 2efc3265 | bellard | --help|-h) show_help=yes |
507 | 2efc3265 | bellard | ;; |
508 | 99123e13 | Mike Frysinger | --version|-V) exec cat $source_path/VERSION |
509 | 99123e13 | Mike Frysinger | ;; |
510 | b1a550a0 | pbrook | --prefix=*) prefix="$optarg" |
511 | 7d13299d | bellard | ;; |
512 | b1a550a0 | pbrook | --interp-prefix=*) interp_prefix="$optarg" |
513 | 32ce6337 | bellard | ;; |
514 | ca4deeb1 | Paolo Bonzini | --source-path=*) |
515 | 7d13299d | bellard | ;; |
516 | ac0df51d | aliguori | --cross-prefix=*) |
517 | 7d13299d | bellard | ;; |
518 | ac0df51d | aliguori | --cc=*) |
519 | 7d13299d | bellard | ;; |
520 | b1a550a0 | pbrook | --host-cc=*) host_cc="$optarg" |
521 | 83469015 | bellard | ;; |
522 | b1a550a0 | pbrook | --make=*) make="$optarg" |
523 | 7d13299d | bellard | ;; |
524 | 6a882643 | pbrook | --install=*) install="$optarg" |
525 | 6a882643 | pbrook | ;; |
526 | c886edfb | Blue Swirl | --python=*) python="$optarg" |
527 | c886edfb | Blue Swirl | ;; |
528 | e2a2ed06 | Juan Quintela | --extra-cflags=*) |
529 | 7d13299d | bellard | ;; |
530 | e2a2ed06 | Juan Quintela | --extra-ldflags=*) |
531 | 7d13299d | bellard | ;; |
532 | 2ff6b91e | Juan Quintela | --cpu=*) |
533 | 7d13299d | bellard | ;; |
534 | b1a550a0 | pbrook | --target-list=*) target_list="$optarg" |
535 | de83cd02 | bellard | ;; |
536 | 74242e0f | Paolo Bonzini | --enable-trace-backend=*) trace_backend="$optarg" |
537 | 94a420b1 | Stefan Hajnoczi | ;; |
538 | 74242e0f | Paolo Bonzini | --with-trace-file=*) trace_file="$optarg" |
539 | 9410b56c | Prerna Saxena | ;; |
540 | 7d13299d | bellard | --enable-gprof) gprof="yes" |
541 | 7d13299d | bellard | ;; |
542 | 79427693 | Loïc Minier | --static) |
543 | 79427693 | Loïc Minier | static="yes" |
544 | 79427693 | Loïc Minier | LDFLAGS="-static $LDFLAGS" |
545 | 43ce4dfe | bellard | ;; |
546 | 0b24e75f | Paolo Bonzini | --mandir=*) mandir="$optarg" |
547 | 0b24e75f | Paolo Bonzini | ;; |
548 | 0b24e75f | Paolo Bonzini | --bindir=*) bindir="$optarg" |
549 | 0b24e75f | Paolo Bonzini | ;; |
550 | 3aa5d2be | Alon Levy | --libdir=*) libdir="$optarg" |
551 | 3aa5d2be | Alon Levy | ;; |
552 | 0f94d6da | Alon Levy | --includedir=*) includedir="$optarg" |
553 | 0f94d6da | Alon Levy | ;; |
554 | 0b24e75f | Paolo Bonzini | --datadir=*) datadir="$optarg" |
555 | 0b24e75f | Paolo Bonzini | ;; |
556 | 0b24e75f | Paolo Bonzini | --docdir=*) docdir="$optarg" |
557 | 0b24e75f | Paolo Bonzini | ;; |
558 | ca2fb938 | Andre Przywara | --sysconfdir=*) sysconfdir="$optarg" |
559 | 07381cc1 | Anthony Liguori | ;; |
560 | 97a847bc | bellard | --disable-sdl) sdl="no" |
561 | 97a847bc | bellard | ;; |
562 | c4198157 | Juan Quintela | --enable-sdl) sdl="yes" |
563 | c4198157 | Juan Quintela | ;; |
564 | 821601ea | Jes Sorensen | --disable-vnc) vnc="no" |
565 | 821601ea | Jes Sorensen | ;; |
566 | 821601ea | Jes Sorensen | --enable-vnc) vnc="yes" |
567 | 821601ea | Jes Sorensen | ;; |
568 | 0c58ac1c | malc | --fmod-lib=*) fmod_lib="$optarg" |
569 | 1d14ffa9 | bellard | ;; |
570 | c2de5c91 | malc | --fmod-inc=*) fmod_inc="$optarg" |
571 | c2de5c91 | malc | ;; |
572 | 2f6a1ab0 | blueswir1 | --oss-lib=*) oss_lib="$optarg" |
573 | 2f6a1ab0 | blueswir1 | ;; |
574 | 2fa7d3bf | malc | --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'` |
575 | 102a52e4 | bellard | ;; |
576 | 0c58ac1c | malc | --audio-drv-list=*) audio_drv_list="$optarg" |
577 | 102a52e4 | bellard | ;; |
578 | eb852011 | Markus Armbruster | --block-drv-whitelist=*) block_drv_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` |
579 | eb852011 | Markus Armbruster | ;; |
580 | f8393946 | aurel32 | --enable-debug-tcg) debug_tcg="yes" |
581 | f8393946 | aurel32 | ;; |
582 | f8393946 | aurel32 | --disable-debug-tcg) debug_tcg="no" |
583 | f8393946 | aurel32 | ;; |
584 | b4475aa2 | Luiz Capitulino | --enable-debug-mon) debug_mon="yes" |
585 | b4475aa2 | Luiz Capitulino | ;; |
586 | b4475aa2 | Luiz Capitulino | --disable-debug-mon) debug_mon="no" |
587 | b4475aa2 | Luiz Capitulino | ;; |
588 | f3d08ee6 | Paul Brook | --enable-debug) |
589 | f3d08ee6 | Paul Brook | # Enable debugging options that aren't excessively noisy |
590 | f3d08ee6 | Paul Brook | debug_tcg="yes" |
591 | b4475aa2 | Luiz Capitulino | debug_mon="yes" |
592 | f3d08ee6 | Paul Brook | debug="yes" |
593 | f3d08ee6 | Paul Brook | strip_opt="no" |
594 | f3d08ee6 | Paul Brook | ;; |
595 | 03b4fe7d | aliguori | --enable-sparse) sparse="yes" |
596 | 03b4fe7d | aliguori | ;; |
597 | 03b4fe7d | aliguori | --disable-sparse) sparse="no" |
598 | 03b4fe7d | aliguori | ;; |
599 | 1625af87 | aliguori | --disable-strip) strip_opt="no" |
600 | 1625af87 | aliguori | ;; |
601 | 8d5d2d4c | ths | --disable-vnc-tls) vnc_tls="no" |
602 | 8d5d2d4c | ths | ;; |
603 | 1be10ad2 | Juan Quintela | --enable-vnc-tls) vnc_tls="yes" |
604 | 1be10ad2 | Juan Quintela | ;; |
605 | 2f9606b3 | aliguori | --disable-vnc-sasl) vnc_sasl="no" |
606 | 2f9606b3 | aliguori | ;; |
607 | ea784e3b | Juan Quintela | --enable-vnc-sasl) vnc_sasl="yes" |
608 | ea784e3b | Juan Quintela | ;; |
609 | 2f6f5c7a | Corentin Chary | --disable-vnc-jpeg) vnc_jpeg="no" |
610 | 2f6f5c7a | Corentin Chary | ;; |
611 | 2f6f5c7a | Corentin Chary | --enable-vnc-jpeg) vnc_jpeg="yes" |
612 | 2f6f5c7a | Corentin Chary | ;; |
613 | efe556ad | Corentin Chary | --disable-vnc-png) vnc_png="no" |
614 | efe556ad | Corentin Chary | ;; |
615 | efe556ad | Corentin Chary | --enable-vnc-png) vnc_png="yes" |
616 | efe556ad | Corentin Chary | ;; |
617 | bd023f95 | Corentin Chary | --disable-vnc-thread) vnc_thread="no" |
618 | bd023f95 | Corentin Chary | ;; |
619 | bd023f95 | Corentin Chary | --enable-vnc-thread) vnc_thread="yes" |
620 | bd023f95 | Corentin Chary | ;; |
621 | 443f1376 | bellard | --disable-slirp) slirp="no" |
622 | 1d14ffa9 | bellard | ;; |
623 | ee682d27 | Stefan Weil | --disable-uuid) uuid="no" |
624 | ee682d27 | Stefan Weil | ;; |
625 | ee682d27 | Stefan Weil | --enable-uuid) uuid="yes" |
626 | ee682d27 | Stefan Weil | ;; |
627 | e0e6c8c0 | aliguori | --disable-vde) vde="no" |
628 | 8a16d273 | ths | ;; |
629 | dfb278bd | Juan Quintela | --enable-vde) vde="yes" |
630 | dfb278bd | Juan Quintela | ;; |
631 | e37630ca | aliguori | --disable-xen) xen="no" |
632 | e37630ca | aliguori | ;; |
633 | fc321b4b | Juan Quintela | --enable-xen) xen="yes" |
634 | fc321b4b | Juan Quintela | ;; |
635 | 2e4d9fb1 | aurel32 | --disable-brlapi) brlapi="no" |
636 | 2e4d9fb1 | aurel32 | ;; |
637 | 4ffcedb6 | Juan Quintela | --enable-brlapi) brlapi="yes" |
638 | 4ffcedb6 | Juan Quintela | ;; |
639 | fb599c9a | balrog | --disable-bluez) bluez="no" |
640 | fb599c9a | balrog | ;; |
641 | a20a6f46 | Juan Quintela | --enable-bluez) bluez="yes" |
642 | a20a6f46 | Juan Quintela | ;; |
643 | 7ba1e619 | aliguori | --disable-kvm) kvm="no" |
644 | 7ba1e619 | aliguori | ;; |
645 | b31a0277 | Juan Quintela | --enable-kvm) kvm="yes" |
646 | b31a0277 | Juan Quintela | ;; |
647 | cd4ec0b4 | Gerd Hoffmann | --disable-spice) spice="no" |
648 | cd4ec0b4 | Gerd Hoffmann | ;; |
649 | cd4ec0b4 | Gerd Hoffmann | --enable-spice) spice="yes" |
650 | cd4ec0b4 | Gerd Hoffmann | ;; |
651 | 05c2a3e7 | bellard | --enable-profiler) profiler="yes" |
652 | 05c2a3e7 | bellard | ;; |
653 | c2de5c91 | malc | --enable-cocoa) |
654 | c2de5c91 | malc | cocoa="yes" ; |
655 | c2de5c91 | malc | sdl="no" ; |
656 | c2de5c91 | malc | audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" |
657 | 1d14ffa9 | bellard | ;; |
658 | cad25d69 | pbrook | --disable-system) softmmu="no" |
659 | 0a8e90f4 | pbrook | ;; |
660 | cad25d69 | pbrook | --enable-system) softmmu="yes" |
661 | 0a8e90f4 | pbrook | ;; |
662 | 0953a80f | Zachary Amsden | --disable-user) |
663 | 0953a80f | Zachary Amsden | linux_user="no" ; |
664 | 0953a80f | Zachary Amsden | bsd_user="no" ; |
665 | 0953a80f | Zachary Amsden | darwin_user="no" |
666 | 0953a80f | Zachary Amsden | ;; |
667 | 0953a80f | Zachary Amsden | --enable-user) ;; |
668 | 831b7825 | ths | --disable-linux-user) linux_user="no" |
669 | 0a8e90f4 | pbrook | ;; |
670 | 831b7825 | ths | --enable-linux-user) linux_user="yes" |
671 | 831b7825 | ths | ;; |
672 | 831b7825 | ths | --disable-darwin-user) darwin_user="no" |
673 | 831b7825 | ths | ;; |
674 | 831b7825 | ths | --enable-darwin-user) darwin_user="yes" |
675 | 0a8e90f4 | pbrook | ;; |
676 | 84778508 | blueswir1 | --disable-bsd-user) bsd_user="no" |
677 | 84778508 | blueswir1 | ;; |
678 | 84778508 | blueswir1 | --enable-bsd-user) bsd_user="yes" |
679 | 84778508 | blueswir1 | ;; |
680 | 379f6698 | Paul Brook | --enable-guest-base) guest_base="yes" |
681 | 379f6698 | Paul Brook | ;; |
682 | 379f6698 | Paul Brook | --disable-guest-base) guest_base="no" |
683 | 379f6698 | Paul Brook | ;; |
684 | 34005a00 | Kirill A. Shutemov | --enable-user-pie) user_pie="yes" |
685 | 34005a00 | Kirill A. Shutemov | ;; |
686 | 34005a00 | Kirill A. Shutemov | --disable-user-pie) user_pie="no" |
687 | 34005a00 | Kirill A. Shutemov | ;; |
688 | c5937220 | pbrook | --enable-uname-release=*) uname_release="$optarg" |
689 | c5937220 | pbrook | ;; |
690 | 3142255c | blueswir1 | --sparc_cpu=*) |
691 | 3142255c | blueswir1 | ;; |
692 | 85aa5189 | bellard | --enable-werror) werror="yes" |
693 | 85aa5189 | bellard | ;; |
694 | 85aa5189 | bellard | --disable-werror) werror="no" |
695 | 85aa5189 | bellard | ;; |
696 | 4d3b6f6e | balrog | --disable-curses) curses="no" |
697 | 4d3b6f6e | balrog | ;; |
698 | c584a6d0 | Juan Quintela | --enable-curses) curses="yes" |
699 | c584a6d0 | Juan Quintela | ;; |
700 | 769ce76d | Alexander Graf | --disable-curl) curl="no" |
701 | 769ce76d | Alexander Graf | ;; |
702 | 788c8196 | Juan Quintela | --enable-curl) curl="yes" |
703 | 788c8196 | Juan Quintela | ;; |
704 | 2df87df7 | Juan Quintela | --disable-fdt) fdt="no" |
705 | 2df87df7 | Juan Quintela | ;; |
706 | 2df87df7 | Juan Quintela | --enable-fdt) fdt="yes" |
707 | 2df87df7 | Juan Quintela | ;; |
708 | 5495ed11 | Luiz Capitulino | --disable-check-utests) check_utests="no" |
709 | 5495ed11 | Luiz Capitulino | ;; |
710 | 5495ed11 | Luiz Capitulino | --enable-check-utests) check_utests="yes" |
711 | 5495ed11 | Luiz Capitulino | ;; |
712 | bd0c5661 | pbrook | --disable-nptl) nptl="no" |
713 | bd0c5661 | pbrook | ;; |
714 | b0a47e79 | Juan Quintela | --enable-nptl) nptl="yes" |
715 | b0a47e79 | Juan Quintela | ;; |
716 | 8ff9cbf7 | malc | --enable-mixemu) mixemu="yes" |
717 | 8ff9cbf7 | malc | ;; |
718 | 5c6c3a6c | Christoph Hellwig | --disable-linux-aio) linux_aio="no" |
719 | 5c6c3a6c | Christoph Hellwig | ;; |
720 | 5c6c3a6c | Christoph Hellwig | --enable-linux-aio) linux_aio="yes" |
721 | 5c6c3a6c | Christoph Hellwig | ;; |
722 | 758e8e38 | Venkateswararao Jujjuri (JV) | --disable-attr) attr="no" |
723 | 758e8e38 | Venkateswararao Jujjuri (JV) | ;; |
724 | 758e8e38 | Venkateswararao Jujjuri (JV) | --enable-attr) attr="yes" |
725 | 758e8e38 | Venkateswararao Jujjuri (JV) | ;; |
726 | e5d355d1 | aliguori | --enable-io-thread) io_thread="yes" |
727 | e5d355d1 | aliguori | ;; |
728 | 77755340 | ths | --disable-blobs) blobs="no" |
729 | 77755340 | ths | ;; |
730 | 4a19f1ec | pbrook | --with-pkgversion=*) pkgversion=" ($optarg)" |
731 | 4a19f1ec | pbrook | ;; |
732 | a25dba17 | Juan Quintela | --disable-docs) docs="no" |
733 | 70ec5dc0 | Anthony Liguori | ;; |
734 | a25dba17 | Juan Quintela | --enable-docs) docs="yes" |
735 | 83a3ab8b | Juan Quintela | ;; |
736 | d5970055 | Michael S. Tsirkin | --disable-vhost-net) vhost_net="no" |
737 | d5970055 | Michael S. Tsirkin | ;; |
738 | d5970055 | Michael S. Tsirkin | --enable-vhost-net) vhost_net="yes" |
739 | d5970055 | Michael S. Tsirkin | ;; |
740 | 20ff075b | Michael Walle | --disable-opengl) opengl="no" |
741 | 20ff075b | Michael Walle | ;; |
742 | 20ff075b | Michael Walle | --enable-opengl) opengl="yes" |
743 | 20ff075b | Michael Walle | ;; |
744 | 6bde81cb | Paolo Bonzini | --*dir) |
745 | 6bde81cb | Paolo Bonzini | ;; |
746 | f27aaf4b | Christian Brunner | --disable-rbd) rbd="no" |
747 | f27aaf4b | Christian Brunner | ;; |
748 | f27aaf4b | Christian Brunner | --enable-rbd) rbd="yes" |
749 | f27aaf4b | Christian Brunner | ;; |
750 | 36707144 | Alon Levy | --disable-smartcard) smartcard="no" |
751 | 36707144 | Alon Levy | ;; |
752 | 36707144 | Alon Levy | --enable-smartcard) smartcard="yes" |
753 | 36707144 | Alon Levy | ;; |
754 | 111a38b0 | Robert Relyea | --disable-smartcard-nss) smartcard_nss="no" |
755 | 111a38b0 | Robert Relyea | ;; |
756 | 111a38b0 | Robert Relyea | --enable-smartcard-nss) smartcard_nss="yes" |
757 | 111a38b0 | Robert Relyea | ;; |
758 | 69354a83 | Hans de Goede | --disable-usb-redir) usb_redir="no" |
759 | 69354a83 | Hans de Goede | ;; |
760 | 69354a83 | Hans de Goede | --enable-usb-redir) usb_redir="yes" |
761 | 69354a83 | Hans de Goede | ;; |
762 | 1ece9905 | Alon Levy | --disable-zlib-test) zlib="no" |
763 | 1ece9905 | Alon Levy | ;; |
764 | d138cee9 | Michael Roth | --enable-guest-agent) guest_agent="yes" |
765 | d138cee9 | Michael Roth | ;; |
766 | d138cee9 | Michael Roth | --disable-guest-agent) guest_agent="no" |
767 | d138cee9 | Michael Roth | ;; |
768 | 7f1559c6 | balrog | *) echo "ERROR: unknown option $opt"; show_help="yes" |
769 | 7f1559c6 | balrog | ;; |
770 | 7d13299d | bellard | esac |
771 | 7d13299d | bellard | done |
772 | 7d13299d | bellard | |
773 | 3142255c | blueswir1 | # |
774 | 3142255c | blueswir1 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right |
775 | a558ee17 | Juan Quintela | # QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) |
776 | 3142255c | blueswir1 | # |
777 | 379f6698 | Paul Brook | host_guest_base="no" |
778 | 40293e58 | bellard | case "$cpu" in |
779 | ed968ff1 | Juan Quintela | sparc) case $sparc_cpu in |
780 | ed968ff1 | Juan Quintela | v7|v8) |
781 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" |
782 | ed968ff1 | Juan Quintela | ;; |
783 | ed968ff1 | Juan Quintela | v8plus|v8plusa) |
784 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" |
785 | ed968ff1 | Juan Quintela | ;; |
786 | ed968ff1 | Juan Quintela | *) # sparc_cpu not defined in the command line |
787 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS" |
788 | ed968ff1 | Juan Quintela | esac |
789 | ed968ff1 | Juan Quintela | LDFLAGS="-m32 $LDFLAGS" |
790 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS" |
791 | 762e8230 | blueswir1 | if test "$solaris" = "no" ; then |
792 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS" |
793 | c81da56e | Juan Quintela | helper_cflags="-ffixed-i0" |
794 | 762e8230 | blueswir1 | fi |
795 | 3142255c | blueswir1 | ;; |
796 | ed968ff1 | Juan Quintela | sparc64) |
797 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS" |
798 | ed968ff1 | Juan Quintela | LDFLAGS="-m64 $LDFLAGS" |
799 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS" |
800 | ed968ff1 | Juan Quintela | if test "$solaris" != "no" ; then |
801 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-ffixed-g1 $QEMU_CFLAGS" |
802 | 762e8230 | blueswir1 | fi |
803 | 3142255c | blueswir1 | ;; |
804 | 76d83bde | ths | s390) |
805 | 28d7cc49 | Richard Henderson | QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS" |
806 | 28d7cc49 | Richard Henderson | LDFLAGS="-m31 $LDFLAGS" |
807 | 48bb3750 | Richard Henderson | host_guest_base="yes" |
808 | 28d7cc49 | Richard Henderson | ;; |
809 | 28d7cc49 | Richard Henderson | s390x) |
810 | 28d7cc49 | Richard Henderson | QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS" |
811 | 28d7cc49 | Richard Henderson | LDFLAGS="-m64 $LDFLAGS" |
812 | 48bb3750 | Richard Henderson | host_guest_base="yes" |
813 | 76d83bde | ths | ;; |
814 | 40293e58 | bellard | i386) |
815 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-m32 $QEMU_CFLAGS" |
816 | 0c439cbf | Juan Quintela | LDFLAGS="-m32 $LDFLAGS" |
817 | 2b2e59e6 | Paolo Bonzini | cc_i386='$(CC) -m32' |
818 | c81da56e | Juan Quintela | helper_cflags="-fomit-frame-pointer" |
819 | 379f6698 | Paul Brook | host_guest_base="yes" |
820 | 40293e58 | bellard | ;; |
821 | 40293e58 | bellard | x86_64) |
822 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-m64 $QEMU_CFLAGS" |
823 | 0c439cbf | Juan Quintela | LDFLAGS="-m64 $LDFLAGS" |
824 | 2b2e59e6 | Paolo Bonzini | cc_i386='$(CC) -m32' |
825 | 379f6698 | Paul Brook | host_guest_base="yes" |
826 | 379f6698 | Paul Brook | ;; |
827 | 379f6698 | Paul Brook | arm*) |
828 | 379f6698 | Paul Brook | host_guest_base="yes" |
829 | 40293e58 | bellard | ;; |
830 | f6548c0a | malc | ppc*) |
831 | f6548c0a | malc | host_guest_base="yes" |
832 | f6548c0a | malc | ;; |
833 | cc01cc8e | Aurelien Jarno | mips*) |
834 | cc01cc8e | Aurelien Jarno | host_guest_base="yes" |
835 | cc01cc8e | Aurelien Jarno | ;; |
836 | 477ba620 | Aurelien Jarno | ia64*) |
837 | 477ba620 | Aurelien Jarno | host_guest_base="yes" |
838 | 477ba620 | Aurelien Jarno | ;; |
839 | fd76e73a | Richard Henderson | hppa*) |
840 | fd76e73a | Richard Henderson | host_guest_base="yes" |
841 | fd76e73a | Richard Henderson | ;; |
842 | d2fbca94 | Guan Xuetao | unicore32*) |
843 | d2fbca94 | Guan Xuetao | host_guest_base="yes" |
844 | d2fbca94 | Guan Xuetao | ;; |
845 | 3142255c | blueswir1 | esac |
846 | 3142255c | blueswir1 | |
847 | 379f6698 | Paul Brook | [ -z "$guest_base" ] && guest_base="$host_guest_base" |
848 | 379f6698 | Paul Brook | |
849 | 60e0df25 | Peter Maydell | |
850 | 60e0df25 | Peter Maydell | default_target_list="" |
851 | 60e0df25 | Peter Maydell | |
852 | 60e0df25 | Peter Maydell | # these targets are portable |
853 | 60e0df25 | Peter Maydell | if [ "$softmmu" = "yes" ] ; then |
854 | 60e0df25 | Peter Maydell | default_target_list="\ |
855 | 60e0df25 | Peter Maydell | i386-softmmu \ |
856 | 60e0df25 | Peter Maydell | x86_64-softmmu \ |
857 | 60e0df25 | Peter Maydell | arm-softmmu \ |
858 | 60e0df25 | Peter Maydell | cris-softmmu \ |
859 | 60e0df25 | Peter Maydell | lm32-softmmu \ |
860 | 60e0df25 | Peter Maydell | m68k-softmmu \ |
861 | 60e0df25 | Peter Maydell | microblaze-softmmu \ |
862 | 60e0df25 | Peter Maydell | microblazeel-softmmu \ |
863 | 60e0df25 | Peter Maydell | mips-softmmu \ |
864 | 60e0df25 | Peter Maydell | mipsel-softmmu \ |
865 | 60e0df25 | Peter Maydell | mips64-softmmu \ |
866 | 60e0df25 | Peter Maydell | mips64el-softmmu \ |
867 | 60e0df25 | Peter Maydell | ppc-softmmu \ |
868 | 60e0df25 | Peter Maydell | ppcemb-softmmu \ |
869 | 60e0df25 | Peter Maydell | ppc64-softmmu \ |
870 | 60e0df25 | Peter Maydell | sh4-softmmu \ |
871 | 60e0df25 | Peter Maydell | sh4eb-softmmu \ |
872 | 60e0df25 | Peter Maydell | sparc-softmmu \ |
873 | 60e0df25 | Peter Maydell | sparc64-softmmu \ |
874 | 0f3301d4 | Alexander Graf | s390x-softmmu \ |
875 | 60e0df25 | Peter Maydell | " |
876 | 60e0df25 | Peter Maydell | fi |
877 | 60e0df25 | Peter Maydell | # the following are Linux specific |
878 | 60e0df25 | Peter Maydell | if [ "$linux_user" = "yes" ] ; then |
879 | 60e0df25 | Peter Maydell | default_target_list="${default_target_list}\ |
880 | 60e0df25 | Peter Maydell | i386-linux-user \ |
881 | 60e0df25 | Peter Maydell | x86_64-linux-user \ |
882 | 60e0df25 | Peter Maydell | alpha-linux-user \ |
883 | 60e0df25 | Peter Maydell | arm-linux-user \ |
884 | 60e0df25 | Peter Maydell | armeb-linux-user \ |
885 | 60e0df25 | Peter Maydell | cris-linux-user \ |
886 | 60e0df25 | Peter Maydell | m68k-linux-user \ |
887 | 60e0df25 | Peter Maydell | microblaze-linux-user \ |
888 | 60e0df25 | Peter Maydell | microblazeel-linux-user \ |
889 | 60e0df25 | Peter Maydell | mips-linux-user \ |
890 | 60e0df25 | Peter Maydell | mipsel-linux-user \ |
891 | 60e0df25 | Peter Maydell | ppc-linux-user \ |
892 | 60e0df25 | Peter Maydell | ppc64-linux-user \ |
893 | 60e0df25 | Peter Maydell | ppc64abi32-linux-user \ |
894 | 60e0df25 | Peter Maydell | sh4-linux-user \ |
895 | 60e0df25 | Peter Maydell | sh4eb-linux-user \ |
896 | 60e0df25 | Peter Maydell | sparc-linux-user \ |
897 | 60e0df25 | Peter Maydell | sparc64-linux-user \ |
898 | 60e0df25 | Peter Maydell | sparc32plus-linux-user \ |
899 | 60e0df25 | Peter Maydell | unicore32-linux-user \ |
900 | 0f3301d4 | Alexander Graf | s390x-linux-user \ |
901 | 60e0df25 | Peter Maydell | " |
902 | 60e0df25 | Peter Maydell | fi |
903 | 60e0df25 | Peter Maydell | # the following are Darwin specific |
904 | 60e0df25 | Peter Maydell | if [ "$darwin_user" = "yes" ] ; then |
905 | 60e0df25 | Peter Maydell | default_target_list="$default_target_list i386-darwin-user ppc-darwin-user " |
906 | 60e0df25 | Peter Maydell | fi |
907 | 60e0df25 | Peter Maydell | # the following are BSD specific |
908 | 60e0df25 | Peter Maydell | if [ "$bsd_user" = "yes" ] ; then |
909 | 60e0df25 | Peter Maydell | default_target_list="${default_target_list}\ |
910 | 60e0df25 | Peter Maydell | i386-bsd-user \ |
911 | 60e0df25 | Peter Maydell | x86_64-bsd-user \ |
912 | 60e0df25 | Peter Maydell | sparc-bsd-user \ |
913 | 60e0df25 | Peter Maydell | sparc64-bsd-user \ |
914 | 60e0df25 | Peter Maydell | " |
915 | 60e0df25 | Peter Maydell | fi |
916 | 60e0df25 | Peter Maydell | |
917 | af5db58e | pbrook | if test x"$show_help" = x"yes" ; then |
918 | af5db58e | pbrook | cat << EOF |
919 | af5db58e | pbrook | |
920 | af5db58e | pbrook | Usage: configure [options] |
921 | af5db58e | pbrook | Options: [defaults in brackets after descriptions] |
922 | af5db58e | pbrook | |
923 | af5db58e | pbrook | EOF |
924 | af5db58e | pbrook | echo "Standard options:" |
925 | af5db58e | pbrook | echo " --help print this message" |
926 | af5db58e | pbrook | echo " --prefix=PREFIX install in PREFIX [$prefix]" |
927 | af5db58e | pbrook | echo " --interp-prefix=PREFIX where to find shared libraries, etc." |
928 | af5db58e | pbrook | echo " use %M for cpu name [$interp_prefix]" |
929 | 60e0df25 | Peter Maydell | echo " --target-list=LIST set target list (default: build everything)" |
930 | 60e0df25 | Peter Maydell | echo "Available targets: $default_target_list" | \ |
931 | 60e0df25 | Peter Maydell | fold -s -w 53 | sed -e 's/^/ /' |
932 | af5db58e | pbrook | echo "" |
933 | af5db58e | pbrook | echo "Advanced options (experts only):" |
934 | af5db58e | pbrook | echo " --source-path=PATH path of source code [$source_path]" |
935 | af5db58e | pbrook | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" |
936 | af5db58e | pbrook | echo " --cc=CC use C compiler CC [$cc]" |
937 | 0bfe8cc0 | Paolo Bonzini | echo " --host-cc=CC use C compiler CC [$host_cc] for code run at" |
938 | 0bfe8cc0 | Paolo Bonzini | echo " build time" |
939 | a558ee17 | Juan Quintela | echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS" |
940 | e3fc14c3 | Jan Kiszka | echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS" |
941 | af5db58e | pbrook | echo " --make=MAKE use specified make [$make]" |
942 | 6a882643 | pbrook | echo " --install=INSTALL use specified install [$install]" |
943 | c886edfb | Blue Swirl | echo " --python=PYTHON use specified python [$python]" |
944 | af5db58e | pbrook | echo " --static enable static build [$static]" |
945 | 0b24e75f | Paolo Bonzini | echo " --mandir=PATH install man pages in PATH" |
946 | 0b24e75f | Paolo Bonzini | echo " --datadir=PATH install firmware in PATH" |
947 | 0b24e75f | Paolo Bonzini | echo " --docdir=PATH install documentation in PATH" |
948 | 0b24e75f | Paolo Bonzini | echo " --bindir=PATH install binaries in PATH" |
949 | 0b24e75f | Paolo Bonzini | echo " --sysconfdir=PATH install config in PATH/qemu" |
950 | f8393946 | aurel32 | echo " --enable-debug-tcg enable TCG debugging" |
951 | f8393946 | aurel32 | echo " --disable-debug-tcg disable TCG debugging (default)" |
952 | 09695a4a | Stefan Weil | echo " --enable-debug enable common debug build options" |
953 | 890b1658 | aliguori | echo " --enable-sparse enable sparse checker" |
954 | 890b1658 | aliguori | echo " --disable-sparse disable sparse checker (default)" |
955 | 1625af87 | aliguori | echo " --disable-strip disable stripping binaries" |
956 | 85aa5189 | bellard | echo " --disable-werror disable compilation abort on warning" |
957 | fe8f78e4 | balrog | echo " --disable-sdl disable SDL" |
958 | c4198157 | Juan Quintela | echo " --enable-sdl enable SDL" |
959 | 821601ea | Jes Sorensen | echo " --disable-vnc disable VNC" |
960 | 821601ea | Jes Sorensen | echo " --enable-vnc enable VNC" |
961 | af5db58e | pbrook | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
962 | c2de5c91 | malc | echo " --audio-drv-list=LIST set audio drivers list:" |
963 | c2de5c91 | malc | echo " Available drivers: $audio_possible_drivers" |
964 | 4c9b53e3 | malc | echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]" |
965 | 4c9b53e3 | malc | echo " Available cards: $audio_possible_cards" |
966 | eb852011 | Markus Armbruster | echo " --block-drv-whitelist=L set block driver whitelist" |
967 | eb852011 | Markus Armbruster | echo " (affects only QEMU, not qemu-img)" |
968 | 8ff9cbf7 | malc | echo " --enable-mixemu enable mixer emulation" |
969 | e37630ca | aliguori | echo " --disable-xen disable xen backend driver support" |
970 | fc321b4b | Juan Quintela | echo " --enable-xen enable xen backend driver support" |
971 | 2e4d9fb1 | aurel32 | echo " --disable-brlapi disable BrlAPI" |
972 | 4ffcedb6 | Juan Quintela | echo " --enable-brlapi enable BrlAPI" |
973 | 8d5d2d4c | ths | echo " --disable-vnc-tls disable TLS encryption for VNC server" |
974 | 1be10ad2 | Juan Quintela | echo " --enable-vnc-tls enable TLS encryption for VNC server" |
975 | 2f9606b3 | aliguori | echo " --disable-vnc-sasl disable SASL encryption for VNC server" |
976 | ea784e3b | Juan Quintela | echo " --enable-vnc-sasl enable SASL encryption for VNC server" |
977 | 2f6f5c7a | Corentin Chary | echo " --disable-vnc-jpeg disable JPEG lossy compression for VNC server" |
978 | 2f6f5c7a | Corentin Chary | echo " --enable-vnc-jpeg enable JPEG lossy compression for VNC server" |
979 | 96763cf9 | Corentin Chary | echo " --disable-vnc-png disable PNG compression for VNC server (default)" |
980 | efe556ad | Corentin Chary | echo " --enable-vnc-png enable PNG compression for VNC server" |
981 | bd023f95 | Corentin Chary | echo " --disable-vnc-thread disable threaded VNC server" |
982 | bd023f95 | Corentin Chary | echo " --enable-vnc-thread enable threaded VNC server" |
983 | af896aaa | pbrook | echo " --disable-curses disable curses output" |
984 | c584a6d0 | Juan Quintela | echo " --enable-curses enable curses output" |
985 | 769ce76d | Alexander Graf | echo " --disable-curl disable curl connectivity" |
986 | 788c8196 | Juan Quintela | echo " --enable-curl enable curl connectivity" |
987 | 2df87df7 | Juan Quintela | echo " --disable-fdt disable fdt device tree" |
988 | 2df87df7 | Juan Quintela | echo " --enable-fdt enable fdt device tree" |
989 | 5495ed11 | Luiz Capitulino | echo " --disable-check-utests disable check unit-tests" |
990 | 5495ed11 | Luiz Capitulino | echo " --enable-check-utests enable check unit-tests" |
991 | fb599c9a | balrog | echo " --disable-bluez disable bluez stack connectivity" |
992 | a20a6f46 | Juan Quintela | echo " --enable-bluez enable bluez stack connectivity" |
993 | 6093d3d4 | Peter Maydell | echo " --disable-slirp disable SLIRP userspace network connectivity" |
994 | 7ba1e619 | aliguori | echo " --disable-kvm disable KVM acceleration support" |
995 | b31a0277 | Juan Quintela | echo " --enable-kvm enable KVM acceleration support" |
996 | bd0c5661 | pbrook | echo " --disable-nptl disable usermode NPTL support" |
997 | e5934d33 | Andre Przywara | echo " --enable-nptl enable usermode NPTL support" |
998 | af5db58e | pbrook | echo " --enable-system enable all system emulation targets" |
999 | af5db58e | pbrook | echo " --disable-system disable all system emulation targets" |
1000 | 0953a80f | Zachary Amsden | echo " --enable-user enable supported user emulation targets" |
1001 | 0953a80f | Zachary Amsden | echo " --disable-user disable all user emulation targets" |
1002 | 831b7825 | ths | echo " --enable-linux-user enable all linux usermode emulation targets" |
1003 | 831b7825 | ths | echo " --disable-linux-user disable all linux usermode emulation targets" |
1004 | 831b7825 | ths | echo " --enable-darwin-user enable all darwin usermode emulation targets" |
1005 | 831b7825 | ths | echo " --disable-darwin-user disable all darwin usermode emulation targets" |
1006 | 84778508 | blueswir1 | echo " --enable-bsd-user enable all BSD usermode emulation targets" |
1007 | 84778508 | blueswir1 | echo " --disable-bsd-user disable all BSD usermode emulation targets" |
1008 | 379f6698 | Paul Brook | echo " --enable-guest-base enable GUEST_BASE support for usermode" |
1009 | 379f6698 | Paul Brook | echo " emulation targets" |
1010 | 379f6698 | Paul Brook | echo " --disable-guest-base disable GUEST_BASE support" |
1011 | 34005a00 | Kirill A. Shutemov | echo " --enable-user-pie build usermode emulation targets as PIE" |
1012 | 34005a00 | Kirill A. Shutemov | echo " --disable-user-pie do not build usermode emulation targets as PIE" |
1013 | af5db58e | pbrook | echo " --fmod-lib path to FMOD library" |
1014 | af5db58e | pbrook | echo " --fmod-inc path to FMOD includes" |
1015 | 2f6a1ab0 | blueswir1 | echo " --oss-lib path to OSS library" |
1016 | c5937220 | pbrook | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
1017 | 3142255c | blueswir1 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" |
1018 | ee682d27 | Stefan Weil | echo " --disable-uuid disable uuid support" |
1019 | ee682d27 | Stefan Weil | echo " --enable-uuid enable uuid support" |
1020 | e0e6c8c0 | aliguori | echo " --disable-vde disable support for vde network" |
1021 | dfb278bd | Juan Quintela | echo " --enable-vde enable support for vde network" |
1022 | 5c6c3a6c | Christoph Hellwig | echo " --disable-linux-aio disable Linux AIO support" |
1023 | 5c6c3a6c | Christoph Hellwig | echo " --enable-linux-aio enable Linux AIO support" |
1024 | 758e8e38 | Venkateswararao Jujjuri (JV) | echo " --disable-attr disables attr and xattr support" |
1025 | 758e8e38 | Venkateswararao Jujjuri (JV) | echo " --enable-attr enable attr and xattr support" |
1026 | e5d355d1 | aliguori | echo " --enable-io-thread enable IO thread" |
1027 | 77755340 | ths | echo " --disable-blobs disable installing provided firmware blobs" |
1028 | d2807bc9 | Dirk Ullrich | echo " --enable-docs enable documentation build" |
1029 | d2807bc9 | Dirk Ullrich | echo " --disable-docs disable documentation build" |
1030 | d5970055 | Michael S. Tsirkin | echo " --disable-vhost-net disable vhost-net acceleration support" |
1031 | d5970055 | Michael S. Tsirkin | echo " --enable-vhost-net enable vhost-net acceleration support" |
1032 | 320fba2a | Fabien Chouteau | echo " --enable-trace-backend=B Set trace backend" |
1033 | 320fba2a | Fabien Chouteau | echo " Available backends:" $("$source_path"/scripts/tracetool --list-backends) |
1034 | 74242e0f | Paolo Bonzini | echo " --with-trace-file=NAME Full PATH,NAME of file to store traces" |
1035 | 9410b56c | Prerna Saxena | echo " Default:trace-<pid>" |
1036 | cd4ec0b4 | Gerd Hoffmann | echo " --disable-spice disable spice" |
1037 | cd4ec0b4 | Gerd Hoffmann | echo " --enable-spice enable spice" |
1038 | f27aaf4b | Christian Brunner | echo " --enable-rbd enable building the rados block device (rbd)" |
1039 | 36707144 | Alon Levy | echo " --disable-smartcard disable smartcard support" |
1040 | 36707144 | Alon Levy | echo " --enable-smartcard enable smartcard support" |
1041 | 111a38b0 | Robert Relyea | echo " --disable-smartcard-nss disable smartcard nss support" |
1042 | 111a38b0 | Robert Relyea | echo " --enable-smartcard-nss enable smartcard nss support" |
1043 | 69354a83 | Hans de Goede | echo " --disable-usb-redir disable usb network redirection support" |
1044 | 69354a83 | Hans de Goede | echo " --enable-usb-redir enable usb network redirection support" |
1045 | d138cee9 | Michael Roth | echo " --disable-guest-agent disable building of the QEMU Guest Agent" |
1046 | d138cee9 | Michael Roth | echo " --enable-guest-agent enable building of the QEMU Guest Agent" |
1047 | af5db58e | pbrook | echo "" |
1048 | 5bf08934 | ths | echo "NOTE: The object files are built at the place where configure is launched" |
1049 | af5db58e | pbrook | exit 1 |
1050 | af5db58e | pbrook | fi |
1051 | af5db58e | pbrook | |
1052 | 8d05095c | Paolo Bonzini | # check that the C compiler works. |
1053 | 8d05095c | Paolo Bonzini | cat > $TMPC <<EOF |
1054 | 8d05095c | Paolo Bonzini | int main(void) {} |
1055 | 8d05095c | Paolo Bonzini | EOF |
1056 | 8d05095c | Paolo Bonzini | |
1057 | 8d05095c | Paolo Bonzini | if compile_object ; then |
1058 | 8d05095c | Paolo Bonzini | : C compiler works ok |
1059 | 8d05095c | Paolo Bonzini | else |
1060 | 8d05095c | Paolo Bonzini | echo "ERROR: \"$cc\" either does not exist or does not work" |
1061 | 8d05095c | Paolo Bonzini | exit 1 |
1062 | 8d05095c | Paolo Bonzini | fi |
1063 | 8d05095c | Paolo Bonzini | |
1064 | 8d05095c | Paolo Bonzini | gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" |
1065 | 8d05095c | Paolo Bonzini | gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" |
1066 | 8d05095c | Paolo Bonzini | gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" |
1067 | f9188227 | Mike Frysinger | gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags" |
1068 | 8d05095c | Paolo Bonzini | cat > $TMPC << EOF |
1069 | 8d05095c | Paolo Bonzini | int main(void) { return 0; } |
1070 | 8d05095c | Paolo Bonzini | EOF |
1071 | 8d05095c | Paolo Bonzini | for flag in $gcc_flags; do |
1072 | 8d05095c | Paolo Bonzini | if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then |
1073 | 8d05095c | Paolo Bonzini | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
1074 | 8d05095c | Paolo Bonzini | fi |
1075 | 8d05095c | Paolo Bonzini | done |
1076 | 8d05095c | Paolo Bonzini | |
1077 | ec530c81 | bellard | # |
1078 | ec530c81 | bellard | # Solaris specific configure tool chain decisions |
1079 | ec530c81 | bellard | # |
1080 | ec530c81 | bellard | if test "$solaris" = "yes" ; then |
1081 | 6792aa11 | Loïc Minier | if has $install; then |
1082 | 6792aa11 | Loïc Minier | : |
1083 | 6792aa11 | Loïc Minier | else |
1084 | ec530c81 | bellard | echo "Solaris install program not found. Use --install=/usr/ucb/install or" |
1085 | ec530c81 | bellard | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" |
1086 | ec530c81 | bellard | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" |
1087 | ec530c81 | bellard | exit 1 |
1088 | ec530c81 | bellard | fi |
1089 | 6792aa11 | Loïc Minier | if test "`path_of $install`" = "/usr/sbin/install" ; then |
1090 | ec530c81 | bellard | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." |
1091 | ec530c81 | bellard | echo "try ginstall from the GNU fileutils available from www.blastwave.org" |
1092 | ec530c81 | bellard | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" |
1093 | ec530c81 | bellard | exit 1 |
1094 | ec530c81 | bellard | fi |
1095 | 6792aa11 | Loïc Minier | if has ar; then |
1096 | 6792aa11 | Loïc Minier | : |
1097 | 6792aa11 | Loïc Minier | else |
1098 | ec530c81 | bellard | echo "Error: No path includes ar" |
1099 | ec530c81 | bellard | if test -f /usr/ccs/bin/ar ; then |
1100 | ec530c81 | bellard | echo "Add /usr/ccs/bin to your path and rerun configure" |
1101 | ec530c81 | bellard | fi |
1102 | ec530c81 | bellard | exit 1 |
1103 | ec530c81 | bellard | fi |
1104 | 5fafdf24 | ths | fi |
1105 | ec530c81 | bellard | |
1106 | d138cee9 | Michael Roth | if test "$guest_agent" != "no" ; then |
1107 | d138cee9 | Michael Roth | if has $python; then |
1108 | d138cee9 | Michael Roth | : |
1109 | d138cee9 | Michael Roth | else |
1110 | d138cee9 | Michael Roth | echo "Python not found. Use --python=/path/to/python" |
1111 | d138cee9 | Michael Roth | exit 1 |
1112 | d138cee9 | Michael Roth | fi |
1113 | c886edfb | Blue Swirl | fi |
1114 | c886edfb | Blue Swirl | |
1115 | 5327cf48 | bellard | if test -z "$target_list" ; then |
1116 | 60e0df25 | Peter Maydell | target_list="$default_target_list" |
1117 | 6e20a45f | bellard | else |
1118 | b1a550a0 | pbrook | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
1119 | 5327cf48 | bellard | fi |
1120 | 0a8e90f4 | pbrook | if test -z "$target_list" ; then |
1121 | 0a8e90f4 | pbrook | echo "No targets enabled" |
1122 | 0a8e90f4 | pbrook | exit 1 |
1123 | 0a8e90f4 | pbrook | fi |
1124 | f55fe278 | Paolo Bonzini | # see if system emulation was really requested |
1125 | f55fe278 | Paolo Bonzini | case " $target_list " in |
1126 | f55fe278 | Paolo Bonzini | *"-softmmu "*) softmmu=yes |
1127 | f55fe278 | Paolo Bonzini | ;; |
1128 | f55fe278 | Paolo Bonzini | *) softmmu=no |
1129 | f55fe278 | Paolo Bonzini | ;; |
1130 | f55fe278 | Paolo Bonzini | esac |
1131 | 5327cf48 | bellard | |
1132 | 249247c9 | Juan Quintela | feature_not_found() { |
1133 | 249247c9 | Juan Quintela | feature=$1 |
1134 | 249247c9 | Juan Quintela | |
1135 | 249247c9 | Juan Quintela | echo "ERROR" |
1136 | 249247c9 | Juan Quintela | echo "ERROR: User requested feature $feature" |
1137 | 9332f6a2 | Sebastian Herbszt | echo "ERROR: configure was not able to find it" |
1138 | 249247c9 | Juan Quintela | echo "ERROR" |
1139 | 249247c9 | Juan Quintela | exit 1; |
1140 | 249247c9 | Juan Quintela | } |
1141 | 249247c9 | Juan Quintela | |
1142 | 7d13299d | bellard | if test -z "$cross_prefix" ; then |
1143 | 7d13299d | bellard | |
1144 | 7d13299d | bellard | # --- |
1145 | 7d13299d | bellard | # big/little endian test |
1146 | 7d13299d | bellard | cat > $TMPC << EOF |
1147 | 7d13299d | bellard | #include <inttypes.h> |
1148 | 7d13299d | bellard | int main(int argc, char ** argv){ |
1149 | 1d14ffa9 | bellard | volatile uint32_t i=0x01234567; |
1150 | 1d14ffa9 | bellard | return (*((uint8_t*)(&i))) == 0x67; |
1151 | 7d13299d | bellard | } |
1152 | 7d13299d | bellard | EOF |
1153 | 7d13299d | bellard | |
1154 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1155 | 7d13299d | bellard | $TMPE && bigendian="yes" |
1156 | 7d13299d | bellard | else |
1157 | 7d13299d | bellard | echo big/little test failed |
1158 | 7d13299d | bellard | fi |
1159 | 7d13299d | bellard | |
1160 | 7d13299d | bellard | else |
1161 | 7d13299d | bellard | |
1162 | 7d13299d | bellard | # if cross compiling, cannot launch a program, so make a static guess |
1163 | ea8f20f8 | Juan Quintela | case "$cpu" in |
1164 | 24e804ec | Alexander Graf | armv4b|hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) |
1165 | ea8f20f8 | Juan Quintela | bigendian=yes |
1166 | ea8f20f8 | Juan Quintela | ;; |
1167 | ea8f20f8 | Juan Quintela | esac |
1168 | 7d13299d | bellard | |
1169 | 7d13299d | bellard | fi |
1170 | 7d13299d | bellard | |
1171 | 70be1a2e | Paolo Bonzini | # host long bits test, actually a pointer size test |
1172 | 70be1a2e | Paolo Bonzini | cat > $TMPC << EOF |
1173 | 70be1a2e | Paolo Bonzini | int sizeof_pointer_is_8[sizeof(void *) == 8 ? 1 : -1]; |
1174 | 70be1a2e | Paolo Bonzini | EOF |
1175 | 70be1a2e | Paolo Bonzini | if compile_object; then |
1176 | 70be1a2e | Paolo Bonzini | hostlongbits=64 |
1177 | 70be1a2e | Paolo Bonzini | else |
1178 | 70be1a2e | Paolo Bonzini | hostlongbits=32 |
1179 | 70be1a2e | Paolo Bonzini | fi |
1180 | b6853697 | bellard | |
1181 | b0a47e79 | Juan Quintela | |
1182 | b0a47e79 | Juan Quintela | ########################################## |
1183 | b0a47e79 | Juan Quintela | # NPTL probe |
1184 | b0a47e79 | Juan Quintela | |
1185 | b0a47e79 | Juan Quintela | if test "$nptl" != "no" ; then |
1186 | b0a47e79 | Juan Quintela | cat > $TMPC <<EOF |
1187 | bd0c5661 | pbrook | #include <sched.h> |
1188 | 30813cea | pbrook | #include <linux/futex.h> |
1189 | bd0c5661 | pbrook | void foo() |
1190 | bd0c5661 | pbrook | { |
1191 | bd0c5661 | pbrook | #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) |
1192 | bd0c5661 | pbrook | #error bork |
1193 | bd0c5661 | pbrook | #endif |
1194 | bd0c5661 | pbrook | } |
1195 | bd0c5661 | pbrook | EOF |
1196 | bd0c5661 | pbrook | |
1197 | b0a47e79 | Juan Quintela | if compile_object ; then |
1198 | b0a47e79 | Juan Quintela | nptl=yes |
1199 | b0a47e79 | Juan Quintela | else |
1200 | b0a47e79 | Juan Quintela | if test "$nptl" = "yes" ; then |
1201 | b0a47e79 | Juan Quintela | feature_not_found "nptl" |
1202 | b0a47e79 | Juan Quintela | fi |
1203 | b0a47e79 | Juan Quintela | nptl=no |
1204 | b0a47e79 | Juan Quintela | fi |
1205 | bd0c5661 | pbrook | fi |
1206 | bd0c5661 | pbrook | |
1207 | 11d9f695 | bellard | ########################################## |
1208 | ac62922e | balrog | # zlib check |
1209 | ac62922e | balrog | |
1210 | 1ece9905 | Alon Levy | if test "$zlib" != "no" ; then |
1211 | 1ece9905 | Alon Levy | cat > $TMPC << EOF |
1212 | ac62922e | balrog | #include <zlib.h> |
1213 | ac62922e | balrog | int main(void) { zlibVersion(); return 0; } |
1214 | ac62922e | balrog | EOF |
1215 | 1ece9905 | Alon Levy | if compile_prog "" "-lz" ; then |
1216 | 1ece9905 | Alon Levy | : |
1217 | 1ece9905 | Alon Levy | else |
1218 | 1ece9905 | Alon Levy | echo |
1219 | 1ece9905 | Alon Levy | echo "Error: zlib check failed" |
1220 | 1ece9905 | Alon Levy | echo "Make sure to have the zlib libs and headers installed." |
1221 | 1ece9905 | Alon Levy | echo |
1222 | 1ece9905 | Alon Levy | exit 1 |
1223 | 1ece9905 | Alon Levy | fi |
1224 | ac62922e | balrog | fi |
1225 | ac62922e | balrog | |
1226 | ac62922e | balrog | ########################################## |
1227 | e37630ca | aliguori | # xen probe |
1228 | e37630ca | aliguori | |
1229 | fc321b4b | Juan Quintela | if test "$xen" != "no" ; then |
1230 | b2266bee | Juan Quintela | xen_libs="-lxenstore -lxenctrl -lxenguest" |
1231 | d5b93ddf | Anthony PERARD | |
1232 | d5b93ddf | Anthony PERARD | # Xen unstable |
1233 | b2266bee | Juan Quintela | cat > $TMPC <<EOF |
1234 | e37630ca | aliguori | #include <xenctrl.h> |
1235 | e37630ca | aliguori | #include <xs.h> |
1236 | d5b93ddf | Anthony PERARD | #include <stdint.h> |
1237 | d5b93ddf | Anthony PERARD | #include <xen/hvm/hvm_info_table.h> |
1238 | d5b93ddf | Anthony PERARD | #if !defined(HVM_MAX_VCPUS) |
1239 | d5b93ddf | Anthony PERARD | # error HVM_MAX_VCPUS not defined |
1240 | d5b93ddf | Anthony PERARD | #endif |
1241 | d5b93ddf | Anthony PERARD | int main(void) { |
1242 | d5b93ddf | Anthony PERARD | xc_interface *xc; |
1243 | d5b93ddf | Anthony PERARD | xs_daemon_open(); |
1244 | d5b93ddf | Anthony PERARD | xc = xc_interface_open(0, 0, 0); |
1245 | d5b93ddf | Anthony PERARD | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
1246 | d5b93ddf | Anthony PERARD | xc_gnttab_open(NULL, 0); |
1247 | b87de24e | Anthony PERARD | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
1248 | d5b93ddf | Anthony PERARD | return 0; |
1249 | d5b93ddf | Anthony PERARD | } |
1250 | e37630ca | aliguori | EOF |
1251 | 52166aa0 | Juan Quintela | if compile_prog "" "$xen_libs" ; then |
1252 | d5b93ddf | Anthony PERARD | xen_ctrl_version=410 |
1253 | fc321b4b | Juan Quintela | xen=yes |
1254 | d5b93ddf | Anthony PERARD | |
1255 | d5b93ddf | Anthony PERARD | # Xen 4.0.0 |
1256 | d5b93ddf | Anthony PERARD | elif ( |
1257 | d5b93ddf | Anthony PERARD | cat > $TMPC <<EOF |
1258 | d5b93ddf | Anthony PERARD | #include <xenctrl.h> |
1259 | d5b93ddf | Anthony PERARD | #include <xs.h> |
1260 | d5b93ddf | Anthony PERARD | #include <stdint.h> |
1261 | d5b93ddf | Anthony PERARD | #include <xen/hvm/hvm_info_table.h> |
1262 | d5b93ddf | Anthony PERARD | #if !defined(HVM_MAX_VCPUS) |
1263 | d5b93ddf | Anthony PERARD | # error HVM_MAX_VCPUS not defined |
1264 | d5b93ddf | Anthony PERARD | #endif |
1265 | d5b93ddf | Anthony PERARD | int main(void) { |
1266 | b87de24e | Anthony PERARD | struct xen_add_to_physmap xatp = { |
1267 | b87de24e | Anthony PERARD | .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, |
1268 | b87de24e | Anthony PERARD | }; |
1269 | d5b93ddf | Anthony PERARD | xs_daemon_open(); |
1270 | d5b93ddf | Anthony PERARD | xc_interface_open(); |
1271 | d5b93ddf | Anthony PERARD | xc_gnttab_open(); |
1272 | d5b93ddf | Anthony PERARD | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
1273 | b87de24e | Anthony PERARD | xc_memory_op(0, XENMEM_add_to_physmap, &xatp); |
1274 | d5b93ddf | Anthony PERARD | return 0; |
1275 | d5b93ddf | Anthony PERARD | } |
1276 | d5b93ddf | Anthony PERARD | EOF |
1277 | d5b93ddf | Anthony PERARD | compile_prog "" "$xen_libs" |
1278 | d5b93ddf | Anthony PERARD | ) ; then |
1279 | d5b93ddf | Anthony PERARD | xen_ctrl_version=400 |
1280 | d5b93ddf | Anthony PERARD | xen=yes |
1281 | d5b93ddf | Anthony PERARD | |
1282 | b87de24e | Anthony PERARD | # Xen 3.4.0 |
1283 | b87de24e | Anthony PERARD | elif ( |
1284 | b87de24e | Anthony PERARD | cat > $TMPC <<EOF |
1285 | b87de24e | Anthony PERARD | #include <xenctrl.h> |
1286 | b87de24e | Anthony PERARD | #include <xs.h> |
1287 | b87de24e | Anthony PERARD | int main(void) { |
1288 | b87de24e | Anthony PERARD | struct xen_add_to_physmap xatp = { |
1289 | b87de24e | Anthony PERARD | .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, |
1290 | b87de24e | Anthony PERARD | }; |
1291 | b87de24e | Anthony PERARD | xs_daemon_open(); |
1292 | b87de24e | Anthony PERARD | xc_interface_open(); |
1293 | b87de24e | Anthony PERARD | xc_gnttab_open(); |
1294 | b87de24e | Anthony PERARD | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
1295 | b87de24e | Anthony PERARD | xc_memory_op(0, XENMEM_add_to_physmap, &xatp); |
1296 | b87de24e | Anthony PERARD | return 0; |
1297 | b87de24e | Anthony PERARD | } |
1298 | b87de24e | Anthony PERARD | EOF |
1299 | b87de24e | Anthony PERARD | compile_prog "" "$xen_libs" |
1300 | b87de24e | Anthony PERARD | ) ; then |
1301 | b87de24e | Anthony PERARD | xen_ctrl_version=340 |
1302 | b87de24e | Anthony PERARD | xen=yes |
1303 | b87de24e | Anthony PERARD | |
1304 | b87de24e | Anthony PERARD | # Xen 3.3.0 |
1305 | d5b93ddf | Anthony PERARD | elif ( |
1306 | d5b93ddf | Anthony PERARD | cat > $TMPC <<EOF |
1307 | d5b93ddf | Anthony PERARD | #include <xenctrl.h> |
1308 | d5b93ddf | Anthony PERARD | #include <xs.h> |
1309 | d5b93ddf | Anthony PERARD | int main(void) { |
1310 | d5b93ddf | Anthony PERARD | xs_daemon_open(); |
1311 | d5b93ddf | Anthony PERARD | xc_interface_open(); |
1312 | d5b93ddf | Anthony PERARD | xc_gnttab_open(); |
1313 | d5b93ddf | Anthony PERARD | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
1314 | d5b93ddf | Anthony PERARD | return 0; |
1315 | d5b93ddf | Anthony PERARD | } |
1316 | d5b93ddf | Anthony PERARD | EOF |
1317 | d5b93ddf | Anthony PERARD | compile_prog "" "$xen_libs" |
1318 | d5b93ddf | Anthony PERARD | ) ; then |
1319 | d5b93ddf | Anthony PERARD | xen_ctrl_version=330 |
1320 | d5b93ddf | Anthony PERARD | xen=yes |
1321 | d5b93ddf | Anthony PERARD | |
1322 | d5b93ddf | Anthony PERARD | # Xen not found or unsupported |
1323 | b2266bee | Juan Quintela | else |
1324 | fc321b4b | Juan Quintela | if test "$xen" = "yes" ; then |
1325 | fc321b4b | Juan Quintela | feature_not_found "xen" |
1326 | fc321b4b | Juan Quintela | fi |
1327 | fc321b4b | Juan Quintela | xen=no |
1328 | b2266bee | Juan Quintela | fi |
1329 | d5b93ddf | Anthony PERARD | |
1330 | d5b93ddf | Anthony PERARD | if test "$xen" = yes; then |
1331 | d5b93ddf | Anthony PERARD | libs_softmmu="$xen_libs $libs_softmmu" |
1332 | d5b93ddf | Anthony PERARD | fi |
1333 | e37630ca | aliguori | fi |
1334 | e37630ca | aliguori | |
1335 | e37630ca | aliguori | ########################################## |
1336 | a8bd70ad | Paolo Bonzini | # pkg-config probe |
1337 | f91672e5 | Paolo Bonzini | |
1338 | a8bd70ad | Paolo Bonzini | if ! has $pkg_config; then |
1339 | 08421541 | Paolo Bonzini | echo warning: proceeding without "$pkg_config" >&2 |
1340 | 08421541 | Paolo Bonzini | pkg_config=/bin/false |
1341 | f91672e5 | Paolo Bonzini | fi |
1342 | f91672e5 | Paolo Bonzini | |
1343 | f91672e5 | Paolo Bonzini | ########################################## |
1344 | 44dc0ca3 | Alon Levy | # libtool probe |
1345 | 44dc0ca3 | Alon Levy | |
1346 | 3f534581 | Brad | if ! has $libtool; then |
1347 | 44dc0ca3 | Alon Levy | libtool= |
1348 | 44dc0ca3 | Alon Levy | fi |
1349 | 44dc0ca3 | Alon Levy | |
1350 | 44dc0ca3 | Alon Levy | ########################################## |
1351 | dfffc653 | Juan Quintela | # Sparse probe |
1352 | dfffc653 | Juan Quintela | if test "$sparse" != "no" ; then |
1353 | 0dba6195 | Loïc Minier | if has cgcc; then |
1354 | dfffc653 | Juan Quintela | sparse=yes |
1355 | dfffc653 | Juan Quintela | else |
1356 | dfffc653 | Juan Quintela | if test "$sparse" = "yes" ; then |
1357 | dfffc653 | Juan Quintela | feature_not_found "sparse" |
1358 | dfffc653 | Juan Quintela | fi |
1359 | dfffc653 | Juan Quintela | sparse=no |
1360 | dfffc653 | Juan Quintela | fi |
1361 | dfffc653 | Juan Quintela | fi |
1362 | dfffc653 | Juan Quintela | |
1363 | dfffc653 | Juan Quintela | ########################################## |
1364 | 11d9f695 | bellard | # SDL probe |
1365 | 11d9f695 | bellard | |
1366 | 3ec87ffe | Paolo Bonzini | # Look for sdl configuration program (pkg-config or sdl-config). Try |
1367 | 3ec87ffe | Paolo Bonzini | # sdl-config even without cross prefix, and favour pkg-config over sdl-config. |
1368 | 3ec87ffe | Paolo Bonzini | if test "`basename $sdl_config`" != sdl-config && ! has ${sdl_config}; then |
1369 | 3ec87ffe | Paolo Bonzini | sdl_config=sdl-config |
1370 | 3ec87ffe | Paolo Bonzini | fi |
1371 | 3ec87ffe | Paolo Bonzini | |
1372 | 3ec87ffe | Paolo Bonzini | if $pkg_config sdl --modversion >/dev/null 2>&1; then |
1373 | a8bd70ad | Paolo Bonzini | sdlconfig="$pkg_config sdl" |
1374 | 9316f803 | Paolo Bonzini | _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'` |
1375 | 3ec87ffe | Paolo Bonzini | elif has ${sdl_config}; then |
1376 | 3ec87ffe | Paolo Bonzini | sdlconfig="$sdl_config" |
1377 | 9316f803 | Paolo Bonzini | _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'` |
1378 | a0dfd8a4 | Loïc Minier | else |
1379 | a0dfd8a4 | Loïc Minier | if test "$sdl" = "yes" ; then |
1380 | a0dfd8a4 | Loïc Minier | feature_not_found "sdl" |
1381 | a0dfd8a4 | Loïc Minier | fi |
1382 | a0dfd8a4 | Loïc Minier | sdl=no |
1383 | 9316f803 | Paolo Bonzini | fi |
1384 | 29e5bada | Scott Wood | if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then |
1385 | 3ec87ffe | Paolo Bonzini | echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 |
1386 | 3ec87ffe | Paolo Bonzini | fi |
1387 | 11d9f695 | bellard | |
1388 | 9316f803 | Paolo Bonzini | sdl_too_old=no |
1389 | c4198157 | Juan Quintela | if test "$sdl" != "no" ; then |
1390 | ac119f9d | Juan Quintela | cat > $TMPC << EOF |
1391 | 11d9f695 | bellard | #include <SDL.h> |
1392 | 11d9f695 | bellard | #undef main /* We don't want SDL to override our main() */ |
1393 | 11d9f695 | bellard | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } |
1394 | 11d9f695 | bellard | EOF |
1395 | 9316f803 | Paolo Bonzini | sdl_cflags=`$sdlconfig --cflags 2> /dev/null` |
1396 | 74f42e18 | TeLeMan | if test "$static" = "yes" ; then |
1397 | 74f42e18 | TeLeMan | sdl_libs=`$sdlconfig --static-libs 2>/dev/null` |
1398 | 74f42e18 | TeLeMan | else |
1399 | 74f42e18 | TeLeMan | sdl_libs=`$sdlconfig --libs 2> /dev/null` |
1400 | 74f42e18 | TeLeMan | fi |
1401 | 52166aa0 | Juan Quintela | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
1402 | ac119f9d | Juan Quintela | if test "$_sdlversion" -lt 121 ; then |
1403 | ac119f9d | Juan Quintela | sdl_too_old=yes |
1404 | ac119f9d | Juan Quintela | else |
1405 | ac119f9d | Juan Quintela | if test "$cocoa" = "no" ; then |
1406 | ac119f9d | Juan Quintela | sdl=yes |
1407 | ac119f9d | Juan Quintela | fi |
1408 | ac119f9d | Juan Quintela | fi |
1409 | cd01b4a3 | aliguori | |
1410 | 67c274d3 | Paolo Bonzini | # static link with sdl ? (note: sdl.pc's --static --libs is broken) |
1411 | ac119f9d | Juan Quintela | if test "$sdl" = "yes" -a "$static" = "yes" ; then |
1412 | 67c274d3 | Paolo Bonzini | if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then |
1413 | f8aa6c7b | Stefan Weil | sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`" |
1414 | f8aa6c7b | Stefan Weil | sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`" |
1415 | ac119f9d | Juan Quintela | fi |
1416 | 52166aa0 | Juan Quintela | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
1417 | ac119f9d | Juan Quintela | : |
1418 | ac119f9d | Juan Quintela | else |
1419 | ac119f9d | Juan Quintela | sdl=no |
1420 | ac119f9d | Juan Quintela | fi |
1421 | ac119f9d | Juan Quintela | fi # static link |
1422 | c4198157 | Juan Quintela | else # sdl not found |
1423 | c4198157 | Juan Quintela | if test "$sdl" = "yes" ; then |
1424 | c4198157 | Juan Quintela | feature_not_found "sdl" |
1425 | c4198157 | Juan Quintela | fi |
1426 | c4198157 | Juan Quintela | sdl=no |
1427 | ac119f9d | Juan Quintela | fi # sdl compile test |
1428 | a68551bc | Juan Quintela | fi |
1429 | 11d9f695 | bellard | |
1430 | 5368a422 | aliguori | if test "$sdl" = "yes" ; then |
1431 | ac119f9d | Juan Quintela | cat > $TMPC <<EOF |
1432 | 5368a422 | aliguori | #include <SDL.h> |
1433 | 5368a422 | aliguori | #if defined(SDL_VIDEO_DRIVER_X11) |
1434 | 5368a422 | aliguori | #include <X11/XKBlib.h> |
1435 | 5368a422 | aliguori | #else |
1436 | 5368a422 | aliguori | #error No x11 support |
1437 | 5368a422 | aliguori | #endif |
1438 | 5368a422 | aliguori | int main(void) { return 0; } |
1439 | 5368a422 | aliguori | EOF |
1440 | 52166aa0 | Juan Quintela | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
1441 | ac119f9d | Juan Quintela | sdl_libs="$sdl_libs -lX11" |
1442 | ac119f9d | Juan Quintela | fi |
1443 | 07d9ac44 | Juan Quintela | if test "$mingw32" = "yes" ; then |
1444 | 07d9ac44 | Juan Quintela | sdl_libs="`echo $sdl_libs | sed s/-mwindows//g` -mconsole" |
1445 | 07d9ac44 | Juan Quintela | fi |
1446 | 0705667e | Juan Quintela | libs_softmmu="$sdl_libs $libs_softmmu" |
1447 | 5368a422 | aliguori | fi |
1448 | 5368a422 | aliguori | |
1449 | 8f28f3fb | ths | ########################################## |
1450 | 8d5d2d4c | ths | # VNC TLS detection |
1451 | 821601ea | Jes Sorensen | if test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then |
1452 | 1be10ad2 | Juan Quintela | cat > $TMPC <<EOF |
1453 | ae6b5e5a | aliguori | #include <gnutls/gnutls.h> |
1454 | ae6b5e5a | aliguori | int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } |
1455 | ae6b5e5a | aliguori | EOF |
1456 | a8bd70ad | Paolo Bonzini | vnc_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null` |
1457 | a8bd70ad | Paolo Bonzini | vnc_tls_libs=`$pkg_config --libs gnutls 2> /dev/null` |
1458 | 1be10ad2 | Juan Quintela | if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then |
1459 | 1be10ad2 | Juan Quintela | vnc_tls=yes |
1460 | 1be10ad2 | Juan Quintela | libs_softmmu="$vnc_tls_libs $libs_softmmu" |
1461 | 1be10ad2 | Juan Quintela | else |
1462 | 1be10ad2 | Juan Quintela | if test "$vnc_tls" = "yes" ; then |
1463 | 1be10ad2 | Juan Quintela | feature_not_found "vnc-tls" |
1464 | ae6b5e5a | aliguori | fi |
1465 | 1be10ad2 | Juan Quintela | vnc_tls=no |
1466 | 1be10ad2 | Juan Quintela | fi |
1467 | 8d5d2d4c | ths | fi |
1468 | 8d5d2d4c | ths | |
1469 | 8d5d2d4c | ths | ########################################## |
1470 | 2f9606b3 | aliguori | # VNC SASL detection |
1471 | 821601ea | Jes Sorensen | if test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then |
1472 | ea784e3b | Juan Quintela | cat > $TMPC <<EOF |
1473 | 2f9606b3 | aliguori | #include <sasl/sasl.h> |
1474 | 2f9606b3 | aliguori | #include <stdio.h> |
1475 | 2f9606b3 | aliguori | int main(void) { sasl_server_init(NULL, "qemu"); return 0; } |
1476 | 2f9606b3 | aliguori | EOF |
1477 | ea784e3b | Juan Quintela | # Assuming Cyrus-SASL installed in /usr prefix |
1478 | ea784e3b | Juan Quintela | vnc_sasl_cflags="" |
1479 | ea784e3b | Juan Quintela | vnc_sasl_libs="-lsasl2" |
1480 | ea784e3b | Juan Quintela | if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then |
1481 | ea784e3b | Juan Quintela | vnc_sasl=yes |
1482 | ea784e3b | Juan Quintela | libs_softmmu="$vnc_sasl_libs $libs_softmmu" |
1483 | ea784e3b | Juan Quintela | else |
1484 | ea784e3b | Juan Quintela | if test "$vnc_sasl" = "yes" ; then |
1485 | ea784e3b | Juan Quintela | feature_not_found "vnc-sasl" |
1486 | 2f9606b3 | aliguori | fi |
1487 | ea784e3b | Juan Quintela | vnc_sasl=no |
1488 | ea784e3b | Juan Quintela | fi |
1489 | 2f9606b3 | aliguori | fi |
1490 | 2f9606b3 | aliguori | |
1491 | 2f9606b3 | aliguori | ########################################## |
1492 | 2f6f5c7a | Corentin Chary | # VNC JPEG detection |
1493 | 821601ea | Jes Sorensen | if test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then |
1494 | 2f6f5c7a | Corentin Chary | cat > $TMPC <<EOF |
1495 | 2f6f5c7a | Corentin Chary | #include <stdio.h> |
1496 | 2f6f5c7a | Corentin Chary | #include <jpeglib.h> |
1497 | 2f6f5c7a | Corentin Chary | int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } |
1498 | 2f6f5c7a | Corentin Chary | EOF |
1499 | 2f6f5c7a | Corentin Chary | vnc_jpeg_cflags="" |
1500 | 2f6f5c7a | Corentin Chary | vnc_jpeg_libs="-ljpeg" |
1501 | 2f6f5c7a | Corentin Chary | if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then |
1502 | 2f6f5c7a | Corentin Chary | vnc_jpeg=yes |
1503 | 2f6f5c7a | Corentin Chary | libs_softmmu="$vnc_jpeg_libs $libs_softmmu" |
1504 | 2f6f5c7a | Corentin Chary | else |
1505 | 2f6f5c7a | Corentin Chary | if test "$vnc_jpeg" = "yes" ; then |
1506 | 2f6f5c7a | Corentin Chary | feature_not_found "vnc-jpeg" |
1507 | 2f6f5c7a | Corentin Chary | fi |
1508 | 2f6f5c7a | Corentin Chary | vnc_jpeg=no |
1509 | 2f6f5c7a | Corentin Chary | fi |
1510 | 2f6f5c7a | Corentin Chary | fi |
1511 | 2f6f5c7a | Corentin Chary | |
1512 | 2f6f5c7a | Corentin Chary | ########################################## |
1513 | efe556ad | Corentin Chary | # VNC PNG detection |
1514 | 821601ea | Jes Sorensen | if test "$vnc" = "yes" -a "$vnc_png" != "no" ; then |
1515 | efe556ad | Corentin Chary | cat > $TMPC <<EOF |
1516 | efe556ad | Corentin Chary | //#include <stdio.h> |
1517 | efe556ad | Corentin Chary | #include <png.h> |
1518 | 832ce9c2 | Scott Wood | #include <stddef.h> |
1519 | efe556ad | Corentin Chary | int main(void) { |
1520 | efe556ad | Corentin Chary | png_structp png_ptr; |
1521 | efe556ad | Corentin Chary | png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); |
1522 | efe556ad | Corentin Chary | return 0; |
1523 | efe556ad | Corentin Chary | } |
1524 | efe556ad | Corentin Chary | EOF |
1525 | 9af8025e | Brad | if $pkg_config libpng --modversion >/dev/null 2>&1; then |
1526 | 9af8025e | Brad | vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null` |
1527 | 9af8025e | Brad | vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null` |
1528 | 9af8025e | Brad | else |
1529 | efe556ad | Corentin Chary | vnc_png_cflags="" |
1530 | efe556ad | Corentin Chary | vnc_png_libs="-lpng" |
1531 | 9af8025e | Brad | fi |
1532 | efe556ad | Corentin Chary | if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then |
1533 | efe556ad | Corentin Chary | vnc_png=yes |
1534 | efe556ad | Corentin Chary | libs_softmmu="$vnc_png_libs $libs_softmmu" |
1535 | 9af8025e | Brad | QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" |
1536 | efe556ad | Corentin Chary | else |
1537 | efe556ad | Corentin Chary | if test "$vnc_png" = "yes" ; then |
1538 | efe556ad | Corentin Chary | feature_not_found "vnc-png" |
1539 | efe556ad | Corentin Chary | fi |
1540 | efe556ad | Corentin Chary | vnc_png=no |
1541 | efe556ad | Corentin Chary | fi |
1542 | efe556ad | Corentin Chary | fi |
1543 | efe556ad | Corentin Chary | |
1544 | efe556ad | Corentin Chary | ########################################## |
1545 | 76655d6d | aliguori | # fnmatch() probe, used for ACL routines |
1546 | 76655d6d | aliguori | fnmatch="no" |
1547 | 76655d6d | aliguori | cat > $TMPC << EOF |
1548 | 76655d6d | aliguori | #include <fnmatch.h> |
1549 | 76655d6d | aliguori | int main(void) |
1550 | 76655d6d | aliguori | { |
1551 | 76655d6d | aliguori | fnmatch("foo", "foo", 0); |
1552 | 76655d6d | aliguori | return 0; |
1553 | 76655d6d | aliguori | } |
1554 | 76655d6d | aliguori | EOF |
1555 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1556 | 76655d6d | aliguori | fnmatch="yes" |
1557 | 76655d6d | aliguori | fi |
1558 | 76655d6d | aliguori | |
1559 | 76655d6d | aliguori | ########################################## |
1560 | ee682d27 | Stefan Weil | # uuid_generate() probe, used for vdi block driver |
1561 | ee682d27 | Stefan Weil | if test "$uuid" != "no" ; then |
1562 | ee682d27 | Stefan Weil | uuid_libs="-luuid" |
1563 | ee682d27 | Stefan Weil | cat > $TMPC << EOF |
1564 | ee682d27 | Stefan Weil | #include <uuid/uuid.h> |
1565 | ee682d27 | Stefan Weil | int main(void) |
1566 | ee682d27 | Stefan Weil | { |
1567 | ee682d27 | Stefan Weil | uuid_t my_uuid; |
1568 | ee682d27 | Stefan Weil | uuid_generate(my_uuid); |
1569 | ee682d27 | Stefan Weil | return 0; |
1570 | ee682d27 | Stefan Weil | } |
1571 | ee682d27 | Stefan Weil | EOF |
1572 | ee682d27 | Stefan Weil | if compile_prog "" "$uuid_libs" ; then |
1573 | ee682d27 | Stefan Weil | uuid="yes" |
1574 | ee682d27 | Stefan Weil | libs_softmmu="$uuid_libs $libs_softmmu" |
1575 | ee682d27 | Stefan Weil | libs_tools="$uuid_libs $libs_tools" |
1576 | ee682d27 | Stefan Weil | else |
1577 | ee682d27 | Stefan Weil | if test "$uuid" = "yes" ; then |
1578 | ee682d27 | Stefan Weil | feature_not_found "uuid" |
1579 | ee682d27 | Stefan Weil | fi |
1580 | ee682d27 | Stefan Weil | uuid=no |
1581 | ee682d27 | Stefan Weil | fi |
1582 | ee682d27 | Stefan Weil | fi |
1583 | ee682d27 | Stefan Weil | |
1584 | ee682d27 | Stefan Weil | ########################################## |
1585 | dce512de | Christoph Hellwig | # xfsctl() probe, used for raw-posix |
1586 | dce512de | Christoph Hellwig | if test "$xfs" != "no" ; then |
1587 | dce512de | Christoph Hellwig | cat > $TMPC << EOF |
1588 | dce512de | Christoph Hellwig | #include <xfs/xfs.h> |
1589 | dce512de | Christoph Hellwig | int main(void) |
1590 | dce512de | Christoph Hellwig | { |
1591 | dce512de | Christoph Hellwig | xfsctl(NULL, 0, 0, NULL); |
1592 | dce512de | Christoph Hellwig | return 0; |
1593 | dce512de | Christoph Hellwig | } |
1594 | dce512de | Christoph Hellwig | EOF |
1595 | dce512de | Christoph Hellwig | if compile_prog "" "" ; then |
1596 | dce512de | Christoph Hellwig | xfs="yes" |
1597 | dce512de | Christoph Hellwig | else |
1598 | dce512de | Christoph Hellwig | if test "$xfs" = "yes" ; then |
1599 | dce512de | Christoph Hellwig | feature_not_found "xfs" |
1600 | dce512de | Christoph Hellwig | fi |
1601 | dce512de | Christoph Hellwig | xfs=no |
1602 | dce512de | Christoph Hellwig | fi |
1603 | dce512de | Christoph Hellwig | fi |
1604 | dce512de | Christoph Hellwig | |
1605 | dce512de | Christoph Hellwig | ########################################## |
1606 | 8a16d273 | ths | # vde libraries probe |
1607 | dfb278bd | Juan Quintela | if test "$vde" != "no" ; then |
1608 | 4baae0ac | Juan Quintela | vde_libs="-lvdeplug" |
1609 | 8a16d273 | ths | cat > $TMPC << EOF |
1610 | 8a16d273 | ths | #include <libvdeplug.h> |
1611 | 4a7f0e06 | pbrook | int main(void) |
1612 | 4a7f0e06 | pbrook | { |
1613 | 4a7f0e06 | pbrook | struct vde_open_args a = {0, 0, 0}; |
1614 | 4a7f0e06 | pbrook | vde_open("", "", &a); |
1615 | 4a7f0e06 | pbrook | return 0; |
1616 | 4a7f0e06 | pbrook | } |
1617 | 8a16d273 | ths | EOF |
1618 | 52166aa0 | Juan Quintela | if compile_prog "" "$vde_libs" ; then |
1619 | 4baae0ac | Juan Quintela | vde=yes |
1620 | 8e02e54c | Juan Quintela | libs_softmmu="$vde_libs $libs_softmmu" |
1621 | 8e02e54c | Juan Quintela | libs_tools="$vde_libs $libs_tools" |
1622 | dfb278bd | Juan Quintela | else |
1623 | dfb278bd | Juan Quintela | if test "$vde" = "yes" ; then |
1624 | dfb278bd | Juan Quintela | feature_not_found "vde" |
1625 | dfb278bd | Juan Quintela | fi |
1626 | dfb278bd | Juan Quintela | vde=no |
1627 | 4baae0ac | Juan Quintela | fi |
1628 | 8a16d273 | ths | fi |
1629 | 8a16d273 | ths | |
1630 | 8a16d273 | ths | ########################################## |
1631 | c2de5c91 | malc | # Sound support libraries probe |
1632 | 8f28f3fb | ths | |
1633 | c2de5c91 | malc | audio_drv_probe() |
1634 | c2de5c91 | malc | { |
1635 | c2de5c91 | malc | drv=$1 |
1636 | c2de5c91 | malc | hdr=$2 |
1637 | c2de5c91 | malc | lib=$3 |
1638 | c2de5c91 | malc | exp=$4 |
1639 | c2de5c91 | malc | cfl=$5 |
1640 | c2de5c91 | malc | cat > $TMPC << EOF |
1641 | c2de5c91 | malc | #include <$hdr> |
1642 | c2de5c91 | malc | int main(void) { $exp } |
1643 | 8f28f3fb | ths | EOF |
1644 | 52166aa0 | Juan Quintela | if compile_prog "$cfl" "$lib" ; then |
1645 | c2de5c91 | malc | : |
1646 | c2de5c91 | malc | else |
1647 | c2de5c91 | malc | echo |
1648 | c2de5c91 | malc | echo "Error: $drv check failed" |
1649 | c2de5c91 | malc | echo "Make sure to have the $drv libs and headers installed." |
1650 | c2de5c91 | malc | echo |
1651 | c2de5c91 | malc | exit 1 |
1652 | c2de5c91 | malc | fi |
1653 | c2de5c91 | malc | } |
1654 | c2de5c91 | malc | |
1655 | 2fa7d3bf | malc | audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` |
1656 | c2de5c91 | malc | for drv in $audio_drv_list; do |
1657 | c2de5c91 | malc | case $drv in |
1658 | c2de5c91 | malc | alsa) |
1659 | c2de5c91 | malc | audio_drv_probe $drv alsa/asoundlib.h -lasound \ |
1660 | c2de5c91 | malc | "snd_pcm_t **handle; return snd_pcm_close(*handle);" |
1661 | a4bf6780 | Juan Quintela | libs_softmmu="-lasound $libs_softmmu" |
1662 | c2de5c91 | malc | ;; |
1663 | c2de5c91 | malc | |
1664 | c2de5c91 | malc | fmod) |
1665 | c2de5c91 | malc | if test -z $fmod_lib || test -z $fmod_inc; then |
1666 | c2de5c91 | malc | echo |
1667 | c2de5c91 | malc | echo "Error: You must specify path to FMOD library and headers" |
1668 | c2de5c91 | malc | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" |
1669 | c2de5c91 | malc | echo |
1670 | c2de5c91 | malc | exit 1 |
1671 | c2de5c91 | malc | fi |
1672 | c2de5c91 | malc | audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" |
1673 | a4bf6780 | Juan Quintela | libs_softmmu="$fmod_lib $libs_softmmu" |
1674 | c2de5c91 | malc | ;; |
1675 | c2de5c91 | malc | |
1676 | c2de5c91 | malc | esd) |
1677 | c2de5c91 | malc | audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' |
1678 | a4bf6780 | Juan Quintela | libs_softmmu="-lesd $libs_softmmu" |
1679 | 67f86e8e | Juan Quintela | audio_pt_int="yes" |
1680 | c2de5c91 | malc | ;; |
1681 | b8e59f18 | malc | |
1682 | b8e59f18 | malc | pa) |
1683 | 493abda6 | Aurelien Jarno | audio_drv_probe $drv pulse/simple.h "-lpulse-simple -lpulse" \ |
1684 | 20fa53ec | Marc-Antoine Perennou | "pa_simple *s = 0; pa_simple_free(s); return 0;" |
1685 | 493abda6 | Aurelien Jarno | libs_softmmu="-lpulse -lpulse-simple $libs_softmmu" |
1686 | 67f86e8e | Juan Quintela | audio_pt_int="yes" |
1687 | b8e59f18 | malc | ;; |
1688 | b8e59f18 | malc | |
1689 | 997e690a | Juan Quintela | coreaudio) |
1690 | 997e690a | Juan Quintela | libs_softmmu="-framework CoreAudio $libs_softmmu" |
1691 | 997e690a | Juan Quintela | ;; |
1692 | 997e690a | Juan Quintela | |
1693 | a4bf6780 | Juan Quintela | dsound) |
1694 | a4bf6780 | Juan Quintela | libs_softmmu="-lole32 -ldxguid $libs_softmmu" |
1695 | d5631638 | malc | audio_win_int="yes" |
1696 | a4bf6780 | Juan Quintela | ;; |
1697 | a4bf6780 | Juan Quintela | |
1698 | a4bf6780 | Juan Quintela | oss) |
1699 | a4bf6780 | Juan Quintela | libs_softmmu="$oss_lib $libs_softmmu" |
1700 | a4bf6780 | Juan Quintela | ;; |
1701 | a4bf6780 | Juan Quintela | |
1702 | a4bf6780 | Juan Quintela | sdl|wav) |
1703 | 2f6a1ab0 | blueswir1 | # XXX: Probes for CoreAudio, DirectSound, SDL(?) |
1704 | 2f6a1ab0 | blueswir1 | ;; |
1705 | 2f6a1ab0 | blueswir1 | |
1706 | d5631638 | malc | winwave) |
1707 | d5631638 | malc | libs_softmmu="-lwinmm $libs_softmmu" |
1708 | d5631638 | malc | audio_win_int="yes" |
1709 | d5631638 | malc | ;; |
1710 | d5631638 | malc | |
1711 | e4c63a6a | malc | *) |
1712 | 1c9b2a52 | malc | echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { |
1713 | e4c63a6a | malc | echo |
1714 | e4c63a6a | malc | echo "Error: Unknown driver '$drv' selected" |
1715 | e4c63a6a | malc | echo "Possible drivers are: $audio_possible_drivers" |
1716 | e4c63a6a | malc | echo |
1717 | e4c63a6a | malc | exit 1 |
1718 | e4c63a6a | malc | } |
1719 | e4c63a6a | malc | ;; |
1720 | c2de5c91 | malc | esac |
1721 | c2de5c91 | malc | done |
1722 | 8f28f3fb | ths | |
1723 | 4d3b6f6e | balrog | ########################################## |
1724 | 2e4d9fb1 | aurel32 | # BrlAPI probe |
1725 | 2e4d9fb1 | aurel32 | |
1726 | 4ffcedb6 | Juan Quintela | if test "$brlapi" != "no" ; then |
1727 | eb82284f | Juan Quintela | brlapi_libs="-lbrlapi" |
1728 | eb82284f | Juan Quintela | cat > $TMPC << EOF |
1729 | 2e4d9fb1 | aurel32 | #include <brlapi.h> |
1730 | 832ce9c2 | Scott Wood | #include <stddef.h> |
1731 | 2e4d9fb1 | aurel32 | int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } |
1732 | 2e4d9fb1 | aurel32 | EOF |
1733 | 52166aa0 | Juan Quintela | if compile_prog "" "$brlapi_libs" ; then |
1734 | eb82284f | Juan Quintela | brlapi=yes |
1735 | 264606b3 | Juan Quintela | libs_softmmu="$brlapi_libs $libs_softmmu" |
1736 | 4ffcedb6 | Juan Quintela | else |
1737 | 4ffcedb6 | Juan Quintela | if test "$brlapi" = "yes" ; then |
1738 | 4ffcedb6 | Juan Quintela | feature_not_found "brlapi" |
1739 | 4ffcedb6 | Juan Quintela | fi |
1740 | 4ffcedb6 | Juan Quintela | brlapi=no |
1741 | eb82284f | Juan Quintela | fi |
1742 | eb82284f | Juan Quintela | fi |
1743 | 2e4d9fb1 | aurel32 | |
1744 | 2e4d9fb1 | aurel32 | ########################################## |
1745 | 4d3b6f6e | balrog | # curses probe |
1746 | e095e2f3 | Stefan Weil | if test "$mingw32" = "yes" ; then |
1747 | e095e2f3 | Stefan Weil | curses_list="-lpdcurses" |
1748 | e095e2f3 | Stefan Weil | else |
1749 | e095e2f3 | Stefan Weil | curses_list="-lncurses -lcurses" |
1750 | e095e2f3 | Stefan Weil | fi |
1751 | 4d3b6f6e | balrog | |
1752 | c584a6d0 | Juan Quintela | if test "$curses" != "no" ; then |
1753 | c584a6d0 | Juan Quintela | curses_found=no |
1754 | 4d3b6f6e | balrog | cat > $TMPC << EOF |
1755 | 4d3b6f6e | balrog | #include <curses.h> |
1756 | 5a8ff3aa | blueswir1 | #ifdef __OpenBSD__ |
1757 | 5a8ff3aa | blueswir1 | #define resize_term resizeterm |
1758 | 5a8ff3aa | blueswir1 | #endif |
1759 | 5a8ff3aa | blueswir1 | int main(void) { resize_term(0, 0); return curses_version(); } |
1760 | 4d3b6f6e | balrog | EOF |
1761 | 4f78ef9a | Juan Quintela | for curses_lib in $curses_list; do |
1762 | 4f78ef9a | Juan Quintela | if compile_prog "" "$curses_lib" ; then |
1763 | c584a6d0 | Juan Quintela | curses_found=yes |
1764 | 4f78ef9a | Juan Quintela | libs_softmmu="$curses_lib $libs_softmmu" |
1765 | 4f78ef9a | Juan Quintela | break |
1766 | 4f78ef9a | Juan Quintela | fi |
1767 | 4f78ef9a | Juan Quintela | done |
1768 | c584a6d0 | Juan Quintela | if test "$curses_found" = "yes" ; then |
1769 | c584a6d0 | Juan Quintela | curses=yes |
1770 | c584a6d0 | Juan Quintela | else |
1771 | c584a6d0 | Juan Quintela | if test "$curses" = "yes" ; then |
1772 | c584a6d0 | Juan Quintela | feature_not_found "curses" |
1773 | c584a6d0 | Juan Quintela | fi |
1774 | c584a6d0 | Juan Quintela | curses=no |
1775 | c584a6d0 | Juan Quintela | fi |
1776 | 4f78ef9a | Juan Quintela | fi |
1777 | 4d3b6f6e | balrog | |
1778 | 414f0dab | blueswir1 | ########################################## |
1779 | 769ce76d | Alexander Graf | # curl probe |
1780 | 769ce76d | Alexander Graf | |
1781 | a8bd70ad | Paolo Bonzini | if $pkg_config libcurl --modversion >/dev/null 2>&1; then |
1782 | a8bd70ad | Paolo Bonzini | curlconfig="$pkg_config libcurl" |
1783 | 4e2b0658 | Paolo Bonzini | else |
1784 | 4e2b0658 | Paolo Bonzini | curlconfig=curl-config |
1785 | 4e2b0658 | Paolo Bonzini | fi |
1786 | 4e2b0658 | Paolo Bonzini | |
1787 | 788c8196 | Juan Quintela | if test "$curl" != "no" ; then |
1788 | 769ce76d | Alexander Graf | cat > $TMPC << EOF |
1789 | 769ce76d | Alexander Graf | #include <curl/curl.h> |
1790 | 0b862ced | Peter Maydell | int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } |
1791 | 769ce76d | Alexander Graf | EOF |
1792 | 4e2b0658 | Paolo Bonzini | curl_cflags=`$curlconfig --cflags 2>/dev/null` |
1793 | 4e2b0658 | Paolo Bonzini | curl_libs=`$curlconfig --libs 2>/dev/null` |
1794 | b1d5a277 | Juan Quintela | if compile_prog "$curl_cflags" "$curl_libs" ; then |
1795 | 769ce76d | Alexander Graf | curl=yes |
1796 | f0302935 | Juan Quintela | libs_tools="$curl_libs $libs_tools" |
1797 | f0302935 | Juan Quintela | libs_softmmu="$curl_libs $libs_softmmu" |
1798 | 788c8196 | Juan Quintela | else |
1799 | 788c8196 | Juan Quintela | if test "$curl" = "yes" ; then |
1800 | 788c8196 | Juan Quintela | feature_not_found "curl" |
1801 | 788c8196 | Juan Quintela | fi |
1802 | 788c8196 | Juan Quintela | curl=no |
1803 | 769ce76d | Alexander Graf | fi |
1804 | 769ce76d | Alexander Graf | fi # test "$curl" |
1805 | 769ce76d | Alexander Graf | |
1806 | 769ce76d | Alexander Graf | ########################################## |
1807 | 5495ed11 | Luiz Capitulino | # check framework probe |
1808 | 5495ed11 | Luiz Capitulino | |
1809 | 5495ed11 | Luiz Capitulino | if test "$check_utests" != "no" ; then |
1810 | 5495ed11 | Luiz Capitulino | cat > $TMPC << EOF |
1811 | 5495ed11 | Luiz Capitulino | #include <check.h> |
1812 | 5495ed11 | Luiz Capitulino | int main(void) { suite_create("qemu test"); return 0; } |
1813 | 5495ed11 | Luiz Capitulino | EOF |
1814 | a8bd70ad | Paolo Bonzini | check_libs=`$pkg_config --libs check` |
1815 | 5495ed11 | Luiz Capitulino | if compile_prog "" $check_libs ; then |
1816 | 5495ed11 | Luiz Capitulino | check_utests=yes |
1817 | 5495ed11 | Luiz Capitulino | libs_tools="$check_libs $libs_tools" |
1818 | 5495ed11 | Luiz Capitulino | else |
1819 | 5495ed11 | Luiz Capitulino | if test "$check_utests" = "yes" ; then |
1820 | 5495ed11 | Luiz Capitulino | feature_not_found "check" |
1821 | 5495ed11 | Luiz Capitulino | fi |
1822 | 5495ed11 | Luiz Capitulino | check_utests=no |
1823 | 5495ed11 | Luiz Capitulino | fi |
1824 | 5495ed11 | Luiz Capitulino | fi # test "$check_utests" |
1825 | 5495ed11 | Luiz Capitulino | |
1826 | 5495ed11 | Luiz Capitulino | ########################################## |
1827 | fb599c9a | balrog | # bluez support probe |
1828 | a20a6f46 | Juan Quintela | if test "$bluez" != "no" ; then |
1829 | e820e3f4 | balrog | cat > $TMPC << EOF |
1830 | e820e3f4 | balrog | #include <bluetooth/bluetooth.h> |
1831 | e820e3f4 | balrog | int main(void) { return bt_error(0); } |
1832 | e820e3f4 | balrog | EOF |
1833 | a8bd70ad | Paolo Bonzini | bluez_cflags=`$pkg_config --cflags bluez 2> /dev/null` |
1834 | a8bd70ad | Paolo Bonzini | bluez_libs=`$pkg_config --libs bluez 2> /dev/null` |
1835 | 52166aa0 | Juan Quintela | if compile_prog "$bluez_cflags" "$bluez_libs" ; then |
1836 | a20a6f46 | Juan Quintela | bluez=yes |
1837 | e482d56a | Juan Quintela | libs_softmmu="$bluez_libs $libs_softmmu" |
1838 | e820e3f4 | balrog | else |
1839 | a20a6f46 | Juan Quintela | if test "$bluez" = "yes" ; then |
1840 | a20a6f46 | Juan Quintela | feature_not_found "bluez" |
1841 | a20a6f46 | Juan Quintela | fi |
1842 | e820e3f4 | balrog | bluez="no" |
1843 | e820e3f4 | balrog | fi |
1844 | fb599c9a | balrog | fi |
1845 | fb599c9a | balrog | |
1846 | fb599c9a | balrog | ########################################## |
1847 | e18df141 | Anthony Liguori | # glib support probe |
1848 | 4b76a481 | Stefan Hajnoczi | if $pkg_config --modversion gthread-2.0 > /dev/null 2>&1 ; then |
1849 | 4b76a481 | Stefan Hajnoczi | glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null` |
1850 | 4b76a481 | Stefan Hajnoczi | glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null` |
1851 | 14015304 | Anthony Liguori | LIBS="$glib_libs $LIBS" |
1852 | 957f1f99 | Michael Roth | libs_qga="$glib_libs $libs_qga" |
1853 | 4b76a481 | Stefan Hajnoczi | else |
1854 | 4b76a481 | Stefan Hajnoczi | echo "glib-2.0 required to compile QEMU" |
1855 | 4b76a481 | Stefan Hajnoczi | exit 1 |
1856 | e18df141 | Anthony Liguori | fi |
1857 | e18df141 | Anthony Liguori | |
1858 | e18df141 | Anthony Liguori | ########################################## |
1859 | e5d355d1 | aliguori | # pthread probe |
1860 | 4b29ec41 | Brad | PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" |
1861 | 3c529d93 | aliguori | |
1862 | 4dd75c70 | Christoph Hellwig | pthread=no |
1863 | e5d355d1 | aliguori | cat > $TMPC << EOF |
1864 | 3c529d93 | aliguori | #include <pthread.h> |
1865 | de65fe0f | Sebastian Herbszt | int main(void) { pthread_create(0,0,0,0); return 0; } |
1866 | 414f0dab | blueswir1 | EOF |
1867 | bd00d539 | Andreas Färber | if compile_prog "" "" ; then |
1868 | bd00d539 | Andreas Färber | pthread=yes |
1869 | bd00d539 | Andreas Färber | else |
1870 | bd00d539 | Andreas Färber | for pthread_lib in $PTHREADLIBS_LIST; do |
1871 | bd00d539 | Andreas Färber | if compile_prog "" "$pthread_lib" ; then |
1872 | bd00d539 | Andreas Färber | pthread=yes |
1873 | bd00d539 | Andreas Färber | LIBS="$pthread_lib $LIBS" |
1874 | bd00d539 | Andreas Färber | break |
1875 | bd00d539 | Andreas Färber | fi |
1876 | bd00d539 | Andreas Färber | done |
1877 | bd00d539 | Andreas Färber | fi |
1878 | 414f0dab | blueswir1 | |
1879 | 4617e593 | Anthony Liguori | if test "$mingw32" != yes -a "$pthread" = no; then |
1880 | 4dd75c70 | Christoph Hellwig | echo |
1881 | 4dd75c70 | Christoph Hellwig | echo "Error: pthread check failed" |
1882 | 4dd75c70 | Christoph Hellwig | echo "Make sure to have the pthread libs and headers installed." |
1883 | 4dd75c70 | Christoph Hellwig | echo |
1884 | 4dd75c70 | Christoph Hellwig | exit 1 |
1885 | e5d355d1 | aliguori | fi |
1886 | e5d355d1 | aliguori | |
1887 | bf9298b9 | aliguori | ########################################## |
1888 | f27aaf4b | Christian Brunner | # rbd probe |
1889 | f27aaf4b | Christian Brunner | if test "$rbd" != "no" ; then |
1890 | f27aaf4b | Christian Brunner | cat > $TMPC <<EOF |
1891 | f27aaf4b | Christian Brunner | #include <stdio.h> |
1892 | ad32e9c0 | Josh Durgin | #include <rbd/librbd.h> |
1893 | f27aaf4b | Christian Brunner | int main(void) { |
1894 | ad32e9c0 | Josh Durgin | rados_t cluster; |
1895 | ad32e9c0 | Josh Durgin | rados_create(&cluster, NULL); |
1896 | f27aaf4b | Christian Brunner | return 0; |
1897 | f27aaf4b | Christian Brunner | } |
1898 | f27aaf4b | Christian Brunner | EOF |
1899 | ad32e9c0 | Josh Durgin | rbd_libs="-lrbd -lrados" |
1900 | ad32e9c0 | Josh Durgin | if compile_prog "" "$rbd_libs" ; then |
1901 | ad32e9c0 | Josh Durgin | rbd=yes |
1902 | ad32e9c0 | Josh Durgin | libs_tools="$rbd_libs $libs_tools" |
1903 | ad32e9c0 | Josh Durgin | libs_softmmu="$rbd_libs $libs_softmmu" |
1904 | f27aaf4b | Christian Brunner | else |
1905 | f27aaf4b | Christian Brunner | if test "$rbd" = "yes" ; then |
1906 | f27aaf4b | Christian Brunner | feature_not_found "rados block device" |
1907 | f27aaf4b | Christian Brunner | fi |
1908 | f27aaf4b | Christian Brunner | rbd=no |
1909 | f27aaf4b | Christian Brunner | fi |
1910 | f27aaf4b | Christian Brunner | fi |
1911 | f27aaf4b | Christian Brunner | |
1912 | f27aaf4b | Christian Brunner | ########################################## |
1913 | 5c6c3a6c | Christoph Hellwig | # linux-aio probe |
1914 | 5c6c3a6c | Christoph Hellwig | |
1915 | 5c6c3a6c | Christoph Hellwig | if test "$linux_aio" != "no" ; then |
1916 | 5c6c3a6c | Christoph Hellwig | cat > $TMPC <<EOF |
1917 | 5c6c3a6c | Christoph Hellwig | #include <libaio.h> |
1918 | 5c6c3a6c | Christoph Hellwig | #include <sys/eventfd.h> |
1919 | 832ce9c2 | Scott Wood | #include <stddef.h> |
1920 | 5c6c3a6c | Christoph Hellwig | int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } |
1921 | 5c6c3a6c | Christoph Hellwig | EOF |
1922 | 5c6c3a6c | Christoph Hellwig | if compile_prog "" "-laio" ; then |
1923 | 5c6c3a6c | Christoph Hellwig | linux_aio=yes |
1924 | 048d179f | Paul Brook | libs_softmmu="$libs_softmmu -laio" |
1925 | 048d179f | Paul Brook | libs_tools="$libs_tools -laio" |
1926 | 5c6c3a6c | Christoph Hellwig | else |
1927 | 5c6c3a6c | Christoph Hellwig | if test "$linux_aio" = "yes" ; then |
1928 | 5c6c3a6c | Christoph Hellwig | feature_not_found "linux AIO" |
1929 | 5c6c3a6c | Christoph Hellwig | fi |
1930 | 3cfcae3c | Luiz Capitulino | linux_aio=no |
1931 | 5c6c3a6c | Christoph Hellwig | fi |
1932 | 5c6c3a6c | Christoph Hellwig | fi |
1933 | 5c6c3a6c | Christoph Hellwig | |
1934 | 5c6c3a6c | Christoph Hellwig | ########################################## |
1935 | 758e8e38 | Venkateswararao Jujjuri (JV) | # attr probe |
1936 | 758e8e38 | Venkateswararao Jujjuri (JV) | |
1937 | 758e8e38 | Venkateswararao Jujjuri (JV) | if test "$attr" != "no" ; then |
1938 | 758e8e38 | Venkateswararao Jujjuri (JV) | cat > $TMPC <<EOF |
1939 | 758e8e38 | Venkateswararao Jujjuri (JV) | #include <stdio.h> |
1940 | 758e8e38 | Venkateswararao Jujjuri (JV) | #include <sys/types.h> |
1941 | 758e8e38 | Venkateswararao Jujjuri (JV) | #include <attr/xattr.h> |
1942 | 758e8e38 | Venkateswararao Jujjuri (JV) | int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } |
1943 | 758e8e38 | Venkateswararao Jujjuri (JV) | EOF |
1944 | 758e8e38 | Venkateswararao Jujjuri (JV) | if compile_prog "" "-lattr" ; then |
1945 | 758e8e38 | Venkateswararao Jujjuri (JV) | attr=yes |
1946 | 758e8e38 | Venkateswararao Jujjuri (JV) | LIBS="-lattr $LIBS" |
1947 | 758e8e38 | Venkateswararao Jujjuri (JV) | else |
1948 | 758e8e38 | Venkateswararao Jujjuri (JV) | if test "$attr" = "yes" ; then |
1949 | 758e8e38 | Venkateswararao Jujjuri (JV) | feature_not_found "ATTR" |
1950 | 758e8e38 | Venkateswararao Jujjuri (JV) | fi |
1951 | 758e8e38 | Venkateswararao Jujjuri (JV) | attr=no |
1952 | 758e8e38 | Venkateswararao Jujjuri (JV) | fi |
1953 | 758e8e38 | Venkateswararao Jujjuri (JV) | fi |
1954 | 758e8e38 | Venkateswararao Jujjuri (JV) | |
1955 | 758e8e38 | Venkateswararao Jujjuri (JV) | ########################################## |
1956 | bf9298b9 | aliguori | # iovec probe |
1957 | bf9298b9 | aliguori | cat > $TMPC <<EOF |
1958 | db34f0b3 | blueswir1 | #include <sys/types.h> |
1959 | bf9298b9 | aliguori | #include <sys/uio.h> |
1960 | db34f0b3 | blueswir1 | #include <unistd.h> |
1961 | bf9298b9 | aliguori | int main(void) { struct iovec iov; return 0; } |
1962 | bf9298b9 | aliguori | EOF |
1963 | bf9298b9 | aliguori | iovec=no |
1964 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1965 | bf9298b9 | aliguori | iovec=yes |
1966 | bf9298b9 | aliguori | fi |
1967 | bf9298b9 | aliguori | |
1968 | f652e6af | aurel32 | ########################################## |
1969 | ceb42de8 | aliguori | # preadv probe |
1970 | ceb42de8 | aliguori | cat > $TMPC <<EOF |
1971 | ceb42de8 | aliguori | #include <sys/types.h> |
1972 | ceb42de8 | aliguori | #include <sys/uio.h> |
1973 | ceb42de8 | aliguori | #include <unistd.h> |
1974 | ceb42de8 | aliguori | int main(void) { preadv; } |
1975 | ceb42de8 | aliguori | EOF |
1976 | ceb42de8 | aliguori | preadv=no |
1977 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1978 | ceb42de8 | aliguori | preadv=yes |
1979 | ceb42de8 | aliguori | fi |
1980 | ceb42de8 | aliguori | |
1981 | ceb42de8 | aliguori | ########################################## |
1982 | f652e6af | aurel32 | # fdt probe |
1983 | 2df87df7 | Juan Quintela | if test "$fdt" != "no" ; then |
1984 | b41af4ba | Juan Quintela | fdt_libs="-lfdt" |
1985 | b41af4ba | Juan Quintela | cat > $TMPC << EOF |
1986 | f652e6af | aurel32 | int main(void) { return 0; } |
1987 | f652e6af | aurel32 | EOF |
1988 | 52166aa0 | Juan Quintela | if compile_prog "" "$fdt_libs" ; then |
1989 | f652e6af | aurel32 | fdt=yes |
1990 | 2df87df7 | Juan Quintela | else |
1991 | 2df87df7 | Juan Quintela | if test "$fdt" = "yes" ; then |
1992 | 2df87df7 | Juan Quintela | feature_not_found "fdt" |
1993 | 2df87df7 | Juan Quintela | fi |
1994 | de3a354a | Michael Walle | fdt_libs= |
1995 | 2df87df7 | Juan Quintela | fdt=no |
1996 | f652e6af | aurel32 | fi |
1997 | f652e6af | aurel32 | fi |
1998 | f652e6af | aurel32 | |
1999 | 20ff075b | Michael Walle | ########################################## |
2000 | 20ff075b | Michael Walle | # opengl probe, used by milkymist-tmu2 |
2001 | 20ff075b | Michael Walle | if test "$opengl" != "no" ; then |
2002 | 20ff075b | Michael Walle | opengl_libs="-lGL" |
2003 | 20ff075b | Michael Walle | cat > $TMPC << EOF |
2004 | 20ff075b | Michael Walle | #include <X11/Xlib.h> |
2005 | 20ff075b | Michael Walle | #include <GL/gl.h> |
2006 | 20ff075b | Michael Walle | #include <GL/glx.h> |
2007 | 20ff075b | Michael Walle | int main(void) { GL_VERSION; return 0; } |
2008 | 20ff075b | Michael Walle | EOF |
2009 | 20ff075b | Michael Walle | if compile_prog "" "-lGL" ; then |
2010 | 20ff075b | Michael Walle | opengl=yes |
2011 | 20ff075b | Michael Walle | else |
2012 | 20ff075b | Michael Walle | if test "$opengl" = "yes" ; then |
2013 | 20ff075b | Michael Walle | feature_not_found "opengl" |
2014 | 20ff075b | Michael Walle | fi |
2015 | de3a354a | Michael Walle | opengl_libs= |
2016 | 20ff075b | Michael Walle | opengl=no |
2017 | 20ff075b | Michael Walle | fi |
2018 | 20ff075b | Michael Walle | fi |
2019 | 20ff075b | Michael Walle | |
2020 | 3b3f24ad | aurel32 | # |
2021 | 3b3f24ad | aurel32 | # Check for xxxat() functions when we are building linux-user |
2022 | 3b3f24ad | aurel32 | # emulator. This is done because older glibc versions don't |
2023 | 3b3f24ad | aurel32 | # have syscall stubs for these implemented. |
2024 | 3b3f24ad | aurel32 | # |
2025 | 3b3f24ad | aurel32 | atfile=no |
2026 | 67ba57f6 | Riku Voipio | cat > $TMPC << EOF |
2027 | 3b3f24ad | aurel32 | #define _ATFILE_SOURCE |
2028 | 3b3f24ad | aurel32 | #include <sys/types.h> |
2029 | 3b3f24ad | aurel32 | #include <fcntl.h> |
2030 | 3b3f24ad | aurel32 | #include <unistd.h> |
2031 | 3b3f24ad | aurel32 | |
2032 | 3b3f24ad | aurel32 | int |
2033 | 3b3f24ad | aurel32 | main(void) |
2034 | 3b3f24ad | aurel32 | { |
2035 | 3b3f24ad | aurel32 | /* try to unlink nonexisting file */ |
2036 | 3b3f24ad | aurel32 | return (unlinkat(AT_FDCWD, "nonexistent_file", 0)); |
2037 | 3b3f24ad | aurel32 | } |
2038 | 3b3f24ad | aurel32 | EOF |
2039 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
2040 | 67ba57f6 | Riku Voipio | atfile=yes |
2041 | 3b3f24ad | aurel32 | fi |
2042 | 3b3f24ad | aurel32 | |
2043 | 39386ac7 | aurel32 | # Check for inotify functions when we are building linux-user |
2044 | 3b3f24ad | aurel32 | # emulator. This is done because older glibc versions don't |
2045 | 3b3f24ad | aurel32 | # have syscall stubs for these implemented. In that case we |
2046 | 3b3f24ad | aurel32 | # don't provide them even if kernel supports them. |
2047 | 3b3f24ad | aurel32 | # |
2048 | 3b3f24ad | aurel32 | inotify=no |
2049 | 67ba57f6 | Riku Voipio | cat > $TMPC << EOF |
2050 | 3b3f24ad | aurel32 | #include <sys/inotify.h> |
2051 | 3b3f24ad | aurel32 | |
2052 | 3b3f24ad | aurel32 | int |
2053 | 3b3f24ad | aurel32 | main(void) |
2054 | 3b3f24ad | aurel32 | { |
2055 | 3b3f24ad | aurel32 | /* try to start inotify */ |
2056 | 8690e420 | aurel32 | return inotify_init(); |
2057 | 3b3f24ad | aurel32 | } |
2058 | 3b3f24ad | aurel32 | EOF |
2059 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
2060 | 67ba57f6 | Riku Voipio | inotify=yes |
2061 | 3b3f24ad | aurel32 | fi |
2062 | 3b3f24ad | aurel32 | |
2063 | c05c7a73 | Riku Voipio | inotify1=no |
2064 | c05c7a73 | Riku Voipio | cat > $TMPC << EOF |
2065 | c05c7a73 | Riku Voipio | #include <sys/inotify.h> |
2066 | c05c7a73 | Riku Voipio | |
2067 | c05c7a73 | Riku Voipio | int |
2068 | c05c7a73 | Riku Voipio | main(void) |
2069 | c05c7a73 | Riku Voipio | { |
2070 | c05c7a73 | Riku Voipio | /* try to start inotify */ |
2071 | c05c7a73 | Riku Voipio | return inotify_init1(0); |
2072 | c05c7a73 | Riku Voipio | } |
2073 | c05c7a73 | Riku Voipio | EOF |
2074 | c05c7a73 | Riku Voipio | if compile_prog "" "" ; then |
2075 | c05c7a73 | Riku Voipio | inotify1=yes |
2076 | c05c7a73 | Riku Voipio | fi |
2077 | c05c7a73 | Riku Voipio | |
2078 | ebc996f3 | Riku Voipio | # check if utimensat and futimens are supported |
2079 | ebc996f3 | Riku Voipio | utimens=no |
2080 | ebc996f3 | Riku Voipio | cat > $TMPC << EOF |
2081 | ebc996f3 | Riku Voipio | #define _ATFILE_SOURCE |
2082 | ebc996f3 | Riku Voipio | #include <stddef.h> |
2083 | ebc996f3 | Riku Voipio | #include <fcntl.h> |
2084 | ebc996f3 | Riku Voipio | |
2085 | ebc996f3 | Riku Voipio | int main(void) |
2086 | ebc996f3 | Riku Voipio | { |
2087 | ebc996f3 | Riku Voipio | utimensat(AT_FDCWD, "foo", NULL, 0); |
2088 | ebc996f3 | Riku Voipio | futimens(0, NULL); |
2089 | ebc996f3 | Riku Voipio | return 0; |
2090 | ebc996f3 | Riku Voipio | } |
2091 | ebc996f3 | Riku Voipio | EOF |
2092 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
2093 | ebc996f3 | Riku Voipio | utimens=yes |
2094 | ebc996f3 | Riku Voipio | fi |
2095 | ebc996f3 | Riku Voipio | |
2096 | 099d6b0f | Riku Voipio | # check if pipe2 is there |
2097 | 099d6b0f | Riku Voipio | pipe2=no |
2098 | 099d6b0f | Riku Voipio | cat > $TMPC << EOF |
2099 | 099d6b0f | Riku Voipio | #include <unistd.h> |
2100 | 099d6b0f | Riku Voipio | #include <fcntl.h> |
2101 | 099d6b0f | Riku Voipio | |
2102 | 099d6b0f | Riku Voipio | int main(void) |
2103 | 099d6b0f | Riku Voipio | { |
2104 | 099d6b0f | Riku Voipio | int pipefd[2]; |
2105 | 099d6b0f | Riku Voipio | pipe2(pipefd, O_CLOEXEC); |
2106 | 099d6b0f | Riku Voipio | return 0; |
2107 | 099d6b0f | Riku Voipio | } |
2108 | 099d6b0f | Riku Voipio | EOF |
2109 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
2110 | 099d6b0f | Riku Voipio | pipe2=yes |
2111 | 099d6b0f | Riku Voipio | fi |
2112 | 099d6b0f | Riku Voipio | |
2113 | 40ff6d7e | Kevin Wolf | # check if accept4 is there |
2114 | 40ff6d7e | Kevin Wolf | accept4=no |
2115 | 40ff6d7e | Kevin Wolf | cat > $TMPC << EOF |
2116 | 40ff6d7e | Kevin Wolf | #include <sys/socket.h> |
2117 | 40ff6d7e | Kevin Wolf | #include <stddef.h> |
2118 | 40ff6d7e | Kevin Wolf | |
2119 | 40ff6d7e | Kevin Wolf | int main(void) |
2120 | 40ff6d7e | Kevin Wolf | { |
2121 | 40ff6d7e | Kevin Wolf | accept4(0, NULL, NULL, SOCK_CLOEXEC); |
2122 | 40ff6d7e | Kevin Wolf | return 0; |
2123 | 40ff6d7e | Kevin Wolf | } |
2124 | 40ff6d7e | Kevin Wolf | EOF |
2125 | 40ff6d7e | Kevin Wolf | if compile_prog "" "" ; then |
2126 | 40ff6d7e | Kevin Wolf | accept4=yes |
2127 | 40ff6d7e | Kevin Wolf | fi |
2128 | 40ff6d7e | Kevin Wolf | |
2129 | 3ce34dfb | vibisreenivasan | # check if tee/splice is there. vmsplice was added same time. |
2130 | 3ce34dfb | vibisreenivasan | splice=no |
2131 | 3ce34dfb | vibisreenivasan | cat > $TMPC << EOF |
2132 | 3ce34dfb | vibisreenivasan | #include <unistd.h> |
2133 | 3ce34dfb | vibisreenivasan | #include <fcntl.h> |
2134 | 3ce34dfb | vibisreenivasan | #include <limits.h> |
2135 | 3ce34dfb | vibisreenivasan | |
2136 | 3ce34dfb | vibisreenivasan | int main(void) |
2137 | 3ce34dfb | vibisreenivasan | { |
2138 | 3ce34dfb | vibisreenivasan | int len, fd; |
2139 | 3ce34dfb | vibisreenivasan | len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); |
2140 | 3ce34dfb | vibisreenivasan | splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); |
2141 | 3ce34dfb | vibisreenivasan | return 0; |
2142 | 3ce34dfb | vibisreenivasan | } |
2143 | 3ce34dfb | vibisreenivasan | EOF |
2144 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
2145 | 3ce34dfb | vibisreenivasan | splice=yes |
2146 | 3ce34dfb | vibisreenivasan | fi |
2147 | 3ce34dfb | vibisreenivasan | |
2148 | dcc38d1c | Marcelo Tosatti | ########################################## |
2149 | dcc38d1c | Marcelo Tosatti | # signalfd probe |
2150 | dcc38d1c | Marcelo Tosatti | signalfd="no" |
2151 | dcc38d1c | Marcelo Tosatti | cat > $TMPC << EOF |
2152 | dcc38d1c | Marcelo Tosatti | #define _GNU_SOURCE |
2153 | dcc38d1c | Marcelo Tosatti | #include <unistd.h> |
2154 | dcc38d1c | Marcelo Tosatti | #include <sys/syscall.h> |
2155 | dcc38d1c | Marcelo Tosatti | #include <signal.h> |
2156 | dcc38d1c | Marcelo Tosatti | int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } |
2157 | dcc38d1c | Marcelo Tosatti | EOF |
2158 | dcc38d1c | Marcelo Tosatti | |
2159 | dcc38d1c | Marcelo Tosatti | if compile_prog "" "" ; then |
2160 | dcc38d1c | Marcelo Tosatti | signalfd=yes |
2161 | de758970 | Jan Kiszka | elif test "$kvm" = "yes" -a "$io_thread" != "yes"; then |
2162 | de758970 | Jan Kiszka | echo |
2163 | de758970 | Jan Kiszka | echo "ERROR: Host kernel lacks signalfd() support," |
2164 | de758970 | Jan Kiszka | echo "but KVM depends on it when the IO thread is disabled." |
2165 | de758970 | Jan Kiszka | echo |
2166 | de758970 | Jan Kiszka | exit 1 |
2167 | dcc38d1c | Marcelo Tosatti | fi |
2168 | dcc38d1c | Marcelo Tosatti | |
2169 | c2882b96 | Riku Voipio | # check if eventfd is supported |
2170 | c2882b96 | Riku Voipio | eventfd=no |
2171 | c2882b96 | Riku Voipio | cat > $TMPC << EOF |
2172 | c2882b96 | Riku Voipio | #include <sys/eventfd.h> |
2173 | c2882b96 | Riku Voipio | |
2174 | c2882b96 | Riku Voipio | int main(void) |
2175 | c2882b96 | Riku Voipio | { |
2176 | c2882b96 | Riku Voipio | int efd = eventfd(0, 0); |
2177 | c2882b96 | Riku Voipio | return 0; |
2178 | c2882b96 | Riku Voipio | } |
2179 | c2882b96 | Riku Voipio | EOF |
2180 | c2882b96 | Riku Voipio | if compile_prog "" "" ; then |
2181 | c2882b96 | Riku Voipio | eventfd=yes |
2182 | c2882b96 | Riku Voipio | fi |
2183 | c2882b96 | Riku Voipio | |
2184 | d0927938 | Ulrich Hecht | # check for fallocate |
2185 | d0927938 | Ulrich Hecht | fallocate=no |
2186 | d0927938 | Ulrich Hecht | cat > $TMPC << EOF |
2187 | d0927938 | Ulrich Hecht | #include <fcntl.h> |
2188 | d0927938 | Ulrich Hecht | |
2189 | d0927938 | Ulrich Hecht | int main(void) |
2190 | d0927938 | Ulrich Hecht | { |
2191 | d0927938 | Ulrich Hecht | fallocate(0, 0, 0, 0); |
2192 | d0927938 | Ulrich Hecht | return 0; |
2193 | d0927938 | Ulrich Hecht | } |
2194 | d0927938 | Ulrich Hecht | EOF |
2195 | be17dc90 | Michael S. Tsirkin | if compile_prog "$ARCH_CFLAGS" "" ; then |
2196 | d0927938 | Ulrich Hecht | fallocate=yes |
2197 | d0927938 | Ulrich Hecht | fi |
2198 | d0927938 | Ulrich Hecht | |
2199 | c727f47d | Peter Maydell | # check for sync_file_range |
2200 | c727f47d | Peter Maydell | sync_file_range=no |
2201 | c727f47d | Peter Maydell | cat > $TMPC << EOF |
2202 | c727f47d | Peter Maydell | #include <fcntl.h> |
2203 | c727f47d | Peter Maydell | |
2204 | c727f47d | Peter Maydell | int main(void) |
2205 | c727f47d | Peter Maydell | { |
2206 | c727f47d | Peter Maydell | sync_file_range(0, 0, 0, 0); |
2207 | c727f47d | Peter Maydell | return 0; |
2208 | c727f47d | Peter Maydell | } |
2209 | c727f47d | Peter Maydell | EOF |
2210 | c727f47d | Peter Maydell | if compile_prog "$ARCH_CFLAGS" "" ; then |
2211 | c727f47d | Peter Maydell | sync_file_range=yes |
2212 | c727f47d | Peter Maydell | fi |
2213 | c727f47d | Peter Maydell | |
2214 | dace20dc | Peter Maydell | # check for linux/fiemap.h and FS_IOC_FIEMAP |
2215 | dace20dc | Peter Maydell | fiemap=no |
2216 | dace20dc | Peter Maydell | cat > $TMPC << EOF |
2217 | dace20dc | Peter Maydell | #include <sys/ioctl.h> |
2218 | dace20dc | Peter Maydell | #include <linux/fs.h> |
2219 | dace20dc | Peter Maydell | #include <linux/fiemap.h> |
2220 | dace20dc | Peter Maydell | |
2221 | dace20dc | Peter Maydell | int main(void) |
2222 | dace20dc | Peter Maydell | { |
2223 | dace20dc | Peter Maydell | ioctl(0, FS_IOC_FIEMAP, 0); |
2224 | dace20dc | Peter Maydell | return 0; |
2225 | dace20dc | Peter Maydell | } |
2226 | dace20dc | Peter Maydell | EOF |
2227 | dace20dc | Peter Maydell | if compile_prog "$ARCH_CFLAGS" "" ; then |
2228 | dace20dc | Peter Maydell | fiemap=yes |
2229 | dace20dc | Peter Maydell | fi |
2230 | dace20dc | Peter Maydell | |
2231 | d0927938 | Ulrich Hecht | # check for dup3 |
2232 | d0927938 | Ulrich Hecht | dup3=no |
2233 | d0927938 | Ulrich Hecht | cat > $TMPC << EOF |
2234 | d0927938 | Ulrich Hecht | #include <unistd.h> |
2235 | d0927938 | Ulrich Hecht | |
2236 | d0927938 | Ulrich Hecht | int main(void) |
2237 | d0927938 | Ulrich Hecht | { |
2238 | d0927938 | Ulrich Hecht | dup3(0, 0, 0); |
2239 | d0927938 | Ulrich Hecht | return 0; |
2240 | d0927938 | Ulrich Hecht | } |
2241 | d0927938 | Ulrich Hecht | EOF |
2242 | 78f5d726 | Jan Kiszka | if compile_prog "" "" ; then |
2243 | d0927938 | Ulrich Hecht | dup3=yes |
2244 | d0927938 | Ulrich Hecht | fi |
2245 | d0927938 | Ulrich Hecht | |
2246 | 3b6edd16 | Peter Maydell | # check for epoll support |
2247 | 3b6edd16 | Peter Maydell | epoll=no |
2248 | 3b6edd16 | Peter Maydell | cat > $TMPC << EOF |
2249 | 3b6edd16 | Peter Maydell | #include <sys/epoll.h> |
2250 | 3b6edd16 | Peter Maydell | |
2251 | 3b6edd16 | Peter Maydell | int main(void) |
2252 | 3b6edd16 | Peter Maydell | { |
2253 | 3b6edd16 | Peter Maydell | epoll_create(0); |
2254 | 3b6edd16 | Peter Maydell | return 0; |
2255 | 3b6edd16 | Peter Maydell | } |
2256 | 3b6edd16 | Peter Maydell | EOF |
2257 | 3b6edd16 | Peter Maydell | if compile_prog "$ARCH_CFLAGS" "" ; then |
2258 | 3b6edd16 | Peter Maydell | epoll=yes |
2259 | 3b6edd16 | Peter Maydell | fi |
2260 | 3b6edd16 | Peter Maydell | |
2261 | 3b6edd16 | Peter Maydell | # epoll_create1 and epoll_pwait are later additions |
2262 | 3b6edd16 | Peter Maydell | # so we must check separately for their presence |
2263 | 3b6edd16 | Peter Maydell | epoll_create1=no |
2264 | 3b6edd16 | Peter Maydell | cat > $TMPC << EOF |
2265 | 3b6edd16 | Peter Maydell | #include <sys/epoll.h> |
2266 | 3b6edd16 | Peter Maydell | |
2267 | 3b6edd16 | Peter Maydell | int main(void) |
2268 | 3b6edd16 | Peter Maydell | { |
2269 | 19e83f6b | Peter Maydell | /* Note that we use epoll_create1 as a value, not as |
2270 | 19e83f6b | Peter Maydell | * a function being called. This is necessary so that on |
2271 | 19e83f6b | Peter Maydell | * old SPARC glibc versions where the function was present in |
2272 | 19e83f6b | Peter Maydell | * the library but not declared in the header file we will |
2273 | 19e83f6b | Peter Maydell | * fail the configure check. (Otherwise we will get a compiler |
2274 | 19e83f6b | Peter Maydell | * warning but not an error, and will proceed to fail the |
2275 | 19e83f6b | Peter Maydell | * qemu compile where we compile with -Werror.) |
2276 | 19e83f6b | Peter Maydell | */ |
2277 | 19e83f6b | Peter Maydell | epoll_create1; |
2278 | 3b6edd16 | Peter Maydell | return 0; |
2279 | 3b6edd16 | Peter Maydell | } |
2280 | 3b6edd16 | Peter Maydell | EOF |
2281 | 3b6edd16 | Peter Maydell | if compile_prog "$ARCH_CFLAGS" "" ; then |
2282 | 3b6edd16 | Peter Maydell | epoll_create1=yes |
2283 | 3b6edd16 | Peter Maydell | fi |
2284 | 3b6edd16 | Peter Maydell | |
2285 | 3b6edd16 | Peter Maydell | epoll_pwait=no |
2286 | 3b6edd16 | Peter Maydell | cat > $TMPC << EOF |
2287 | 3b6edd16 | Peter Maydell | #include <sys/epoll.h> |
2288 | 3b6edd16 | Peter Maydell | |
2289 | 3b6edd16 | Peter Maydell | int main(void) |
2290 | 3b6edd16 | Peter Maydell | { |
2291 | 3b6edd16 | Peter Maydell | epoll_pwait(0, 0, 0, 0, 0); |
2292 | 3b6edd16 | Peter Maydell | return 0; |
2293 | 3b6edd16 | Peter Maydell | } |
2294 | 3b6edd16 | Peter Maydell | EOF |
2295 | 3b6edd16 | Peter Maydell | if compile_prog "$ARCH_CFLAGS" "" ; then |
2296 | 3b6edd16 | Peter Maydell | epoll_pwait=yes |
2297 | 3b6edd16 | Peter Maydell | fi |
2298 | 3b6edd16 | Peter Maydell | |
2299 | cc8ae6de | pbrook | # Check if tools are available to build documentation. |
2300 | a25dba17 | Juan Quintela | if test "$docs" != "no" ; then |
2301 | 01668d98 | Stefan Weil | if has makeinfo && has pod2man; then |
2302 | a25dba17 | Juan Quintela | docs=yes |
2303 | 83a3ab8b | Juan Quintela | else |
2304 | a25dba17 | Juan Quintela | if test "$docs" = "yes" ; then |
2305 | a25dba17 | Juan Quintela | feature_not_found "docs" |
2306 | 83a3ab8b | Juan Quintela | fi |
2307 | a25dba17 | Juan Quintela | docs=no |
2308 | 83a3ab8b | Juan Quintela | fi |
2309 | cc8ae6de | pbrook | fi |
2310 | cc8ae6de | pbrook | |
2311 | f514f41c | Stefan Weil | # Search for bswap_32 function |
2312 | 6ae9a1f4 | Juan Quintela | byteswap_h=no |
2313 | 6ae9a1f4 | Juan Quintela | cat > $TMPC << EOF |
2314 | 6ae9a1f4 | Juan Quintela | #include <byteswap.h> |
2315 | 6ae9a1f4 | Juan Quintela | int main(void) { return bswap_32(0); } |
2316 | 6ae9a1f4 | Juan Quintela | EOF |
2317 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
2318 | 6ae9a1f4 | Juan Quintela | byteswap_h=yes |
2319 | 6ae9a1f4 | Juan Quintela | fi |
2320 | 6ae9a1f4 | Juan Quintela | |
2321 | f514f41c | Stefan Weil | # Search for bswap_32 function |
2322 | 6ae9a1f4 | Juan Quintela | bswap_h=no |
2323 | 6ae9a1f4 | Juan Quintela | cat > $TMPC << EOF |
2324 | 6ae9a1f4 | Juan Quintela | #include <sys/endian.h> |
2325 | 6ae9a1f4 | Juan Quintela | #include <sys/types.h> |
2326 | 6ae9a1f4 | Juan Quintela | #include <machine/bswap.h> |
2327 | 6ae9a1f4 | Juan Quintela | int main(void) { return bswap32(0); } |
2328 | 6ae9a1f4 | Juan Quintela | EOF |
2329 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
2330 | 6ae9a1f4 | Juan Quintela | bswap_h=yes |
2331 | 6ae9a1f4 | Juan Quintela | fi |
2332 | 6ae9a1f4 | Juan Quintela | |
2333 | da93a1fd | aliguori | ########################################## |
2334 | da93a1fd | aliguori | # Do we need librt |
2335 | da93a1fd | aliguori | cat > $TMPC <<EOF |
2336 | da93a1fd | aliguori | #include <signal.h> |
2337 | da93a1fd | aliguori | #include <time.h> |
2338 | da93a1fd | aliguori | int main(void) { clockid_t id; return clock_gettime(id, NULL); } |
2339 | da93a1fd | aliguori | EOF |
2340 | da93a1fd | aliguori | |
2341 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
2342 | 07ffa4bd | Juan Quintela | : |
2343 | 52166aa0 | Juan Quintela | elif compile_prog "" "-lrt" ; then |
2344 | 07ffa4bd | Juan Quintela | LIBS="-lrt $LIBS" |
2345 | da93a1fd | aliguori | fi |
2346 | da93a1fd | aliguori | |
2347 | 31ff504d | Blue Swirl | if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ |
2348 | 179cf400 | Andreas Färber | "$aix" != "yes" -a "$haiku" != "yes" ; then |
2349 | 6362a53f | Juan Quintela | libs_softmmu="-lutil $libs_softmmu" |
2350 | 6362a53f | Juan Quintela | fi |
2351 | 6362a53f | Juan Quintela | |
2352 | de5071c5 | Blue Swirl | ########################################## |
2353 | de5071c5 | Blue Swirl | # check if the compiler defines offsetof |
2354 | de5071c5 | Blue Swirl | |
2355 | de5071c5 | Blue Swirl | need_offsetof=yes |
2356 | de5071c5 | Blue Swirl | cat > $TMPC << EOF |
2357 | de5071c5 | Blue Swirl | #include <stddef.h> |
2358 | de5071c5 | Blue Swirl | int main(void) { struct s { int f; }; return offsetof(struct s, f); } |
2359 | de5071c5 | Blue Swirl | EOF |
2360 | de5071c5 | Blue Swirl | if compile_prog "" "" ; then |
2361 | de5071c5 | Blue Swirl | need_offsetof=no |
2362 | de5071c5 | Blue Swirl | fi |
2363 | de5071c5 | Blue Swirl | |
2364 | 5f6b9e8f | Blue Swirl | ########################################## |
2365 | 747bbdf7 | Blue Swirl | # check if the compiler understands attribute warn_unused_result |
2366 | 747bbdf7 | Blue Swirl | # |
2367 | 747bbdf7 | Blue Swirl | # This could be smarter, but gcc -Werror does not error out even when warning |
2368 | 747bbdf7 | Blue Swirl | # about attribute warn_unused_result |
2369 | 747bbdf7 | Blue Swirl | |
2370 | 747bbdf7 | Blue Swirl | gcc_attribute_warn_unused_result=no |
2371 | 747bbdf7 | Blue Swirl | cat > $TMPC << EOF |
2372 | 747bbdf7 | Blue Swirl | #if defined(__GNUC__) && (__GNUC__ < 4) && defined(__GNUC_MINOR__) && (__GNUC__ < 4) |
2373 | 747bbdf7 | Blue Swirl | #error gcc 3.3 or older |
2374 | 747bbdf7 | Blue Swirl | #endif |
2375 | 747bbdf7 | Blue Swirl | int main(void) { return 0;} |
2376 | 747bbdf7 | Blue Swirl | EOF |
2377 | 747bbdf7 | Blue Swirl | if compile_prog "" ""; then |
2378 | 747bbdf7 | Blue Swirl | gcc_attribute_warn_unused_result=yes |
2379 | 747bbdf7 | Blue Swirl | fi |
2380 | 747bbdf7 | Blue Swirl | |
2381 | cd4ec0b4 | Gerd Hoffmann | # spice probe |
2382 | cd4ec0b4 | Gerd Hoffmann | if test "$spice" != "no" ; then |
2383 | cd4ec0b4 | Gerd Hoffmann | cat > $TMPC << EOF |
2384 | cd4ec0b4 | Gerd Hoffmann | #include <spice.h> |
2385 | cd4ec0b4 | Gerd Hoffmann | int main(void) { spice_server_new(); return 0; } |
2386 | cd4ec0b4 | Gerd Hoffmann | EOF |
2387 | 710fc4f5 | Jiri Denemark | spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) |
2388 | 710fc4f5 | Jiri Denemark | spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) |
2389 | 012b80d3 | Gerd Hoffmann | if $pkg_config --atleast-version=0.6.0 spice-server >/dev/null 2>&1 && \ |
2390 | cd4ec0b4 | Gerd Hoffmann | compile_prog "$spice_cflags" "$spice_libs" ; then |
2391 | cd4ec0b4 | Gerd Hoffmann | spice="yes" |
2392 | cd4ec0b4 | Gerd Hoffmann | libs_softmmu="$libs_softmmu $spice_libs" |
2393 | cd4ec0b4 | Gerd Hoffmann | QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" |
2394 | cd4ec0b4 | Gerd Hoffmann | else |
2395 | cd4ec0b4 | Gerd Hoffmann | if test "$spice" = "yes" ; then |
2396 | cd4ec0b4 | Gerd Hoffmann | feature_not_found "spice" |
2397 | cd4ec0b4 | Gerd Hoffmann | fi |
2398 | cd4ec0b4 | Gerd Hoffmann | spice="no" |
2399 | cd4ec0b4 | Gerd Hoffmann | fi |
2400 | cd4ec0b4 | Gerd Hoffmann | fi |
2401 | cd4ec0b4 | Gerd Hoffmann | |
2402 | 111a38b0 | Robert Relyea | # check for libcacard for smartcard support |
2403 | 111a38b0 | Robert Relyea | if test "$smartcard" != "no" ; then |
2404 | 111a38b0 | Robert Relyea | smartcard="yes" |
2405 | 111a38b0 | Robert Relyea | smartcard_cflags="" |
2406 | 111a38b0 | Robert Relyea | # TODO - what's the minimal nss version we support? |
2407 | 111a38b0 | Robert Relyea | if test "$smartcard_nss" != "no"; then |
2408 | 111a38b0 | Robert Relyea | if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 ; then |
2409 | 111a38b0 | Robert Relyea | smartcard_nss="yes" |
2410 | 111a38b0 | Robert Relyea | smartcard_cflags="-I\$(SRC_PATH)/libcacard" |
2411 | 111a38b0 | Robert Relyea | libcacard_libs=$($pkg_config --libs nss 2>/dev/null) |
2412 | 111a38b0 | Robert Relyea | libcacard_cflags=$($pkg_config --cflags nss 2>/dev/null) |
2413 | 111a38b0 | Robert Relyea | QEMU_CFLAGS="$QEMU_CFLAGS $smartcard_cflags $libcacard_cflags" |
2414 | 111a38b0 | Robert Relyea | LIBS="$libcacard_libs $LIBS" |
2415 | 111a38b0 | Robert Relyea | else |
2416 | 111a38b0 | Robert Relyea | if test "$smartcard_nss" = "yes"; then |
2417 | 111a38b0 | Robert Relyea | feature_not_found "nss" |
2418 | 111a38b0 | Robert Relyea | fi |
2419 | 111a38b0 | Robert Relyea | smartcard_nss="no" |
2420 | 111a38b0 | Robert Relyea | fi |
2421 | 111a38b0 | Robert Relyea | fi |
2422 | 111a38b0 | Robert Relyea | fi |
2423 | 111a38b0 | Robert Relyea | if test "$smartcard" = "no" ; then |
2424 | 111a38b0 | Robert Relyea | smartcard_nss="no" |
2425 | 111a38b0 | Robert Relyea | fi |
2426 | 111a38b0 | Robert Relyea | |
2427 | 69354a83 | Hans de Goede | # check for usbredirparser for usb network redirection support |
2428 | 69354a83 | Hans de Goede | if test "$usb_redir" != "no" ; then |
2429 | 69354a83 | Hans de Goede | if $pkg_config libusbredirparser >/dev/null 2>&1 ; then |
2430 | 69354a83 | Hans de Goede | usb_redir="yes" |
2431 | 69354a83 | Hans de Goede | usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null) |
2432 | 69354a83 | Hans de Goede | usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null) |
2433 | 69354a83 | Hans de Goede | QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags" |
2434 | 69354a83 | Hans de Goede | LIBS="$LIBS $usb_redir_libs" |
2435 | 69354a83 | Hans de Goede | else |
2436 | 69354a83 | Hans de Goede | if test "$usb_redir" = "yes"; then |
2437 | 69354a83 | Hans de Goede | feature_not_found "usb-redir" |
2438 | 69354a83 | Hans de Goede | fi |
2439 | 69354a83 | Hans de Goede | usb_redir="no" |
2440 | 69354a83 | Hans de Goede | fi |
2441 | 69354a83 | Hans de Goede | fi |
2442 | 69354a83 | Hans de Goede | |
2443 | cd4ec0b4 | Gerd Hoffmann | ########################################## |
2444 | cd4ec0b4 | Gerd Hoffmann | |
2445 | 747bbdf7 | Blue Swirl | ########################################## |
2446 | 5f6b9e8f | Blue Swirl | # check if we have fdatasync |
2447 | 5f6b9e8f | Blue Swirl | |
2448 | 5f6b9e8f | Blue Swirl | fdatasync=no |
2449 | 5f6b9e8f | Blue Swirl | cat > $TMPC << EOF |
2450 | 5f6b9e8f | Blue Swirl | #include <unistd.h> |
2451 | d1722a27 | Alexandre Raymond | int main(void) { |
2452 | d1722a27 | Alexandre Raymond | #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 |
2453 | d1722a27 | Alexandre Raymond | return fdatasync(0); |
2454 | d1722a27 | Alexandre Raymond | #else |
2455 | d1722a27 | Alexandre Raymond | #abort Not supported |
2456 | d1722a27 | Alexandre Raymond | #endif |
2457 | d1722a27 | Alexandre Raymond | } |
2458 | 5f6b9e8f | Blue Swirl | EOF |
2459 | 5f6b9e8f | Blue Swirl | if compile_prog "" "" ; then |
2460 | 5f6b9e8f | Blue Swirl | fdatasync=yes |
2461 | 5f6b9e8f | Blue Swirl | fi |
2462 | 5f6b9e8f | Blue Swirl | |
2463 | 94a420b1 | Stefan Hajnoczi | ########################################## |
2464 | e78815a5 | Andreas Färber | # check if we have madvise |
2465 | e78815a5 | Andreas Färber | |
2466 | e78815a5 | Andreas Färber | madvise=no |
2467 | e78815a5 | Andreas Färber | cat > $TMPC << EOF |
2468 | e78815a5 | Andreas Färber | #include <sys/types.h> |
2469 | e78815a5 | Andreas Färber | #include <sys/mman.h> |
2470 | 832ce9c2 | Scott Wood | #include <stddef.h> |
2471 | e78815a5 | Andreas Färber | int main(void) { return madvise(NULL, 0, MADV_DONTNEED); } |
2472 | e78815a5 | Andreas Färber | EOF |
2473 | e78815a5 | Andreas Färber | if compile_prog "" "" ; then |
2474 | e78815a5 | Andreas Färber | madvise=yes |
2475 | e78815a5 | Andreas Färber | fi |
2476 | e78815a5 | Andreas Färber | |
2477 | e78815a5 | Andreas Färber | ########################################## |
2478 | e78815a5 | Andreas Färber | # check if we have posix_madvise |
2479 | e78815a5 | Andreas Färber | |
2480 | e78815a5 | Andreas Färber | posix_madvise=no |
2481 | e78815a5 | Andreas Färber | cat > $TMPC << EOF |
2482 | e78815a5 | Andreas Färber | #include <sys/mman.h> |
2483 | 832ce9c2 | Scott Wood | #include <stddef.h> |
2484 | e78815a5 | Andreas Färber | int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } |
2485 | e78815a5 | Andreas Färber | EOF |
2486 | e78815a5 | Andreas Färber | if compile_prog "" "" ; then |
2487 | e78815a5 | Andreas Färber | posix_madvise=yes |
2488 | e78815a5 | Andreas Färber | fi |
2489 | e78815a5 | Andreas Färber | |
2490 | e78815a5 | Andreas Färber | ########################################## |
2491 | 94a420b1 | Stefan Hajnoczi | # check if trace backend exists |
2492 | 94a420b1 | Stefan Hajnoczi | |
2493 | 4c3b5a48 | Blue Swirl | sh "$source_path/scripts/tracetool" "--$trace_backend" --check-backend > /dev/null 2> /dev/null |
2494 | 94a420b1 | Stefan Hajnoczi | if test "$?" -ne 0 ; then |
2495 | 94a420b1 | Stefan Hajnoczi | echo |
2496 | 94a420b1 | Stefan Hajnoczi | echo "Error: invalid trace backend" |
2497 | 94a420b1 | Stefan Hajnoczi | echo "Please choose a supported trace backend." |
2498 | 94a420b1 | Stefan Hajnoczi | echo |
2499 | 94a420b1 | Stefan Hajnoczi | exit 1 |
2500 | 94a420b1 | Stefan Hajnoczi | fi |
2501 | 94a420b1 | Stefan Hajnoczi | |
2502 | 7e24e92a | Stefan Hajnoczi | ########################################## |
2503 | 7e24e92a | Stefan Hajnoczi | # For 'ust' backend, test if ust headers are present |
2504 | 7e24e92a | Stefan Hajnoczi | if test "$trace_backend" = "ust"; then |
2505 | 7e24e92a | Stefan Hajnoczi | cat > $TMPC << EOF |
2506 | 7e24e92a | Stefan Hajnoczi | #include <ust/tracepoint.h> |
2507 | 7e24e92a | Stefan Hajnoczi | #include <ust/marker.h> |
2508 | 7e24e92a | Stefan Hajnoczi | int main(void) { return 0; } |
2509 | 7e24e92a | Stefan Hajnoczi | EOF |
2510 | 7e24e92a | Stefan Hajnoczi | if compile_prog "" "" ; then |
2511 | 7e24e92a | Stefan Hajnoczi | LIBS="-lust $LIBS" |
2512 | 7e24e92a | Stefan Hajnoczi | else |
2513 | 7e24e92a | Stefan Hajnoczi | echo |
2514 | 7e24e92a | Stefan Hajnoczi | echo "Error: Trace backend 'ust' missing libust header files" |
2515 | 7e24e92a | Stefan Hajnoczi | echo |
2516 | 7e24e92a | Stefan Hajnoczi | exit 1 |
2517 | 7e24e92a | Stefan Hajnoczi | fi |
2518 | 7e24e92a | Stefan Hajnoczi | fi |
2519 | b3d08c02 | Daniel P. Berrange | |
2520 | b3d08c02 | Daniel P. Berrange | ########################################## |
2521 | b3d08c02 | Daniel P. Berrange | # For 'dtrace' backend, test if 'dtrace' command is present |
2522 | b3d08c02 | Daniel P. Berrange | if test "$trace_backend" = "dtrace"; then |
2523 | b3d08c02 | Daniel P. Berrange | if ! has 'dtrace' ; then |
2524 | b3d08c02 | Daniel P. Berrange | echo |
2525 | b3d08c02 | Daniel P. Berrange | echo "Error: dtrace command is not found in PATH $PATH" |
2526 | b3d08c02 | Daniel P. Berrange | echo |
2527 | b3d08c02 | Daniel P. Berrange | exit 1 |
2528 | b3d08c02 | Daniel P. Berrange | fi |
2529 | c276b17d | Daniel P. Berrange | trace_backend_stap="no" |
2530 | c276b17d | Daniel P. Berrange | if has 'stap' ; then |
2531 | c276b17d | Daniel P. Berrange | trace_backend_stap="yes" |
2532 | c276b17d | Daniel P. Berrange | fi |
2533 | b3d08c02 | Daniel P. Berrange | fi |
2534 | b3d08c02 | Daniel P. Berrange | |
2535 | 7e24e92a | Stefan Hajnoczi | ########################################## |
2536 | 023367e6 | Wolfgang Mauerer | # __sync_fetch_and_and requires at least -march=i486. Many toolchains |
2537 | 023367e6 | Wolfgang Mauerer | # use i686 as default anyway, but for those that don't, an explicit |
2538 | 023367e6 | Wolfgang Mauerer | # specification is necessary |
2539 | 1ba16968 | Stefan Weil | if test "$vhost_net" = "yes" && test "$cpu" = "i386"; then |
2540 | 023367e6 | Wolfgang Mauerer | cat > $TMPC << EOF |
2541 | 023367e6 | Wolfgang Mauerer | int sfaa(unsigned *ptr) |
2542 | 023367e6 | Wolfgang Mauerer | { |
2543 | 023367e6 | Wolfgang Mauerer | return __sync_fetch_and_and(ptr, 0); |
2544 | 023367e6 | Wolfgang Mauerer | } |
2545 | 023367e6 | Wolfgang Mauerer | |
2546 | 023367e6 | Wolfgang Mauerer | int main(int argc, char **argv) |
2547 | 023367e6 | Wolfgang Mauerer | { |
2548 | 023367e6 | Wolfgang Mauerer | int val = 42; |
2549 | 023367e6 | Wolfgang Mauerer | sfaa(&val); |
2550 | 023367e6 | Wolfgang Mauerer | return val; |
2551 | 023367e6 | Wolfgang Mauerer | } |
2552 | 023367e6 | Wolfgang Mauerer | EOF |
2553 | 023367e6 | Wolfgang Mauerer | if ! compile_prog "" "" ; then |
2554 | 023367e6 | Wolfgang Mauerer | CFLAGS+="-march=i486" |
2555 | 023367e6 | Wolfgang Mauerer | fi |
2556 | 023367e6 | Wolfgang Mauerer | fi |
2557 | 023367e6 | Wolfgang Mauerer | |
2558 | 023367e6 | Wolfgang Mauerer | ########################################## |
2559 | d0e2fce5 | Aneesh Kumar K.V | # check if we have makecontext |
2560 | d0e2fce5 | Aneesh Kumar K.V | |
2561 | d0e2fce5 | Aneesh Kumar K.V | ucontext_coroutine=no |
2562 | d0e2fce5 | Aneesh Kumar K.V | if test "$darwin" != "yes"; then |
2563 | d0e2fce5 | Aneesh Kumar K.V | cat > $TMPC << EOF |
2564 | d0e2fce5 | Aneesh Kumar K.V | #include <ucontext.h> |
2565 | d0e2fce5 | Aneesh Kumar K.V | int main(void) { makecontext(0, 0, 0); } |
2566 | d0e2fce5 | Aneesh Kumar K.V | EOF |
2567 | d0e2fce5 | Aneesh Kumar K.V | if compile_prog "" "" ; then |
2568 | d0e2fce5 | Aneesh Kumar K.V | ucontext_coroutine=yes |
2569 | d0e2fce5 | Aneesh Kumar K.V | fi |
2570 | d0e2fce5 | Aneesh Kumar K.V | fi |
2571 | d0e2fce5 | Aneesh Kumar K.V | |
2572 | d0e2fce5 | Aneesh Kumar K.V | ########################################## |
2573 | e86ecd4b | Juan Quintela | # End of CC checks |
2574 | e86ecd4b | Juan Quintela | # After here, no more $cc or $ld runs |
2575 | e86ecd4b | Juan Quintela | |
2576 | e86ecd4b | Juan Quintela | if test "$debug" = "no" ; then |
2577 | 1156c669 | Juan Quintela | CFLAGS="-O2 $CFLAGS" |
2578 | e86ecd4b | Juan Quintela | fi |
2579 | a316e378 | Juan Quintela | |
2580 | e86ecd4b | Juan Quintela | # Consult white-list to determine whether to enable werror |
2581 | e86ecd4b | Juan Quintela | # by default. Only enable by default for git builds |
2582 | 20ff6c80 | Anthony Liguori | z_version=`cut -f3 -d. $source_path/VERSION` |
2583 | 20ff6c80 | Anthony Liguori | |
2584 | e86ecd4b | Juan Quintela | if test -z "$werror" ; then |
2585 | e86ecd4b | Juan Quintela | if test "$z_version" = "50" -a \ |
2586 | e86ecd4b | Juan Quintela | "$linux" = "yes" ; then |
2587 | e86ecd4b | Juan Quintela | werror="yes" |
2588 | e86ecd4b | Juan Quintela | else |
2589 | e86ecd4b | Juan Quintela | werror="no" |
2590 | e86ecd4b | Juan Quintela | fi |
2591 | e86ecd4b | Juan Quintela | fi |
2592 | e86ecd4b | Juan Quintela | |
2593 | 20ff6c80 | Anthony Liguori | # Disable zero malloc errors for official releases unless explicitly told to |
2594 | 20ff6c80 | Anthony Liguori | # enable/disable |
2595 | 20ff6c80 | Anthony Liguori | if test -z "$zero_malloc" ; then |
2596 | 20ff6c80 | Anthony Liguori | if test "$z_version" = "50" ; then |
2597 | 20ff6c80 | Anthony Liguori | zero_malloc="no" |
2598 | 20ff6c80 | Anthony Liguori | else |
2599 | 20ff6c80 | Anthony Liguori | zero_malloc="yes" |
2600 | 20ff6c80 | Anthony Liguori | fi |
2601 | 20ff6c80 | Anthony Liguori | fi |
2602 | 20ff6c80 | Anthony Liguori | |
2603 | e86ecd4b | Juan Quintela | if test "$werror" = "yes" ; then |
2604 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-Werror $QEMU_CFLAGS" |
2605 | e86ecd4b | Juan Quintela | fi |
2606 | e86ecd4b | Juan Quintela | |
2607 | e86ecd4b | Juan Quintela | if test "$solaris" = "no" ; then |
2608 | e86ecd4b | Juan Quintela | if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then |
2609 | 1156c669 | Juan Quintela | LDFLAGS="-Wl,--warn-common $LDFLAGS" |
2610 | e86ecd4b | Juan Quintela | fi |
2611 | e86ecd4b | Juan Quintela | fi |
2612 | e86ecd4b | Juan Quintela | |
2613 | 952afb71 | Blue Swirl | # Use ASLR, no-SEH and DEP if available |
2614 | 952afb71 | Blue Swirl | if test "$mingw32" = "yes" ; then |
2615 | 952afb71 | Blue Swirl | for flag in --dynamicbase --no-seh --nxcompat; do |
2616 | 952afb71 | Blue Swirl | if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then |
2617 | 952afb71 | Blue Swirl | LDFLAGS="-Wl,$flag $LDFLAGS" |
2618 | 952afb71 | Blue Swirl | fi |
2619 | 952afb71 | Blue Swirl | done |
2620 | 952afb71 | Blue Swirl | fi |
2621 | 952afb71 | Blue Swirl | |
2622 | 190e9c59 | Paolo Bonzini | confdir=$sysconfdir$confsuffix |
2623 | e7b45cc4 | Paolo Bonzini | |
2624 | ca35f780 | Paolo Bonzini | tools= |
2625 | ca35f780 | Paolo Bonzini | if test "$softmmu" = yes ; then |
2626 | ca35f780 | Paolo Bonzini | tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" |
2627 | ca35f780 | Paolo Bonzini | if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then |
2628 | ca35f780 | Paolo Bonzini | tools="qemu-nbd\$(EXESUF) $tools" |
2629 | d138cee9 | Michael Roth | if [ "$guest_agent" = "yes" ]; then |
2630 | 48ff7a62 | Michael Roth | tools="qemu-ga\$(EXESUF) $tools" |
2631 | d138cee9 | Michael Roth | fi |
2632 | ca35f780 | Paolo Bonzini | if [ "$check_utests" = "yes" ]; then |
2633 | ca35f780 | Paolo Bonzini | tools="check-qint check-qstring check-qdict check-qlist $tools" |
2634 | ca35f780 | Paolo Bonzini | tools="check-qfloat check-qjson $tools" |
2635 | ca35f780 | Paolo Bonzini | fi |
2636 | ca35f780 | Paolo Bonzini | fi |
2637 | ca35f780 | Paolo Bonzini | fi |
2638 | ca35f780 | Paolo Bonzini | |
2639 | ca35f780 | Paolo Bonzini | # Mac OS X ships with a broken assembler |
2640 | ca35f780 | Paolo Bonzini | roms= |
2641 | ca35f780 | Paolo Bonzini | if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ |
2642 | ca35f780 | Paolo Bonzini | "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ |
2643 | ca35f780 | Paolo Bonzini | "$softmmu" = yes ; then |
2644 | ca35f780 | Paolo Bonzini | roms="optionrom" |
2645 | ca35f780 | Paolo Bonzini | fi |
2646 | d0384d1d | Andreas Färber | if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then |
2647 | 39ac8455 | David Gibson | roms="$roms spapr-rtas" |
2648 | 39ac8455 | David Gibson | fi |
2649 | ca35f780 | Paolo Bonzini | |
2650 | 43ce4dfe | bellard | echo "Install prefix $prefix" |
2651 | f2b9e1e3 | Paolo Bonzini | echo "BIOS directory `eval echo $datadir`" |
2652 | f2b9e1e3 | Paolo Bonzini | echo "binary directory `eval echo $bindir`" |
2653 | 3aa5d2be | Alon Levy | echo "library directory `eval echo $libdir`" |
2654 | 0f94d6da | Alon Levy | echo "include directory `eval echo $includedir`" |
2655 | 1c0fd160 | Aurelien Jarno | echo "config directory `eval echo $sysconfdir`" |
2656 | 11d9f695 | bellard | if test "$mingw32" = "no" ; then |
2657 | f2b9e1e3 | Paolo Bonzini | echo "Manual directory `eval echo $mandir`" |
2658 | 43ce4dfe | bellard | echo "ELF interp prefix $interp_prefix" |
2659 | 11d9f695 | bellard | fi |
2660 | 5a67135a | bellard | echo "Source path $source_path" |
2661 | 43ce4dfe | bellard | echo "C compiler $cc" |
2662 | 83469015 | bellard | echo "Host C compiler $host_cc" |
2663 | 0c439cbf | Juan Quintela | echo "CFLAGS $CFLAGS" |
2664 | a558ee17 | Juan Quintela | echo "QEMU_CFLAGS $QEMU_CFLAGS" |
2665 | 0c439cbf | Juan Quintela | echo "LDFLAGS $LDFLAGS" |
2666 | 43ce4dfe | bellard | echo "make $make" |
2667 | 6a882643 | pbrook | echo "install $install" |
2668 | c886edfb | Blue Swirl | echo "python $python" |
2669 | 43ce4dfe | bellard | echo "host CPU $cpu" |
2670 | de83cd02 | bellard | echo "host big endian $bigendian" |
2671 | 97a847bc | bellard | echo "target list $target_list" |
2672 | ade25b0d | aurel32 | echo "tcg debug enabled $debug_tcg" |
2673 | b4475aa2 | Luiz Capitulino | echo "Mon debug enabled $debug_mon" |
2674 | 43ce4dfe | bellard | echo "gprof enabled $gprof" |
2675 | 03b4fe7d | aliguori | echo "sparse enabled $sparse" |
2676 | 1625af87 | aliguori | echo "strip binaries $strip_opt" |
2677 | 05c2a3e7 | bellard | echo "profiler $profiler" |
2678 | 43ce4dfe | bellard | echo "static build $static" |
2679 | 85aa5189 | bellard | echo "-Werror enabled $werror" |
2680 | 5b0753e0 | bellard | if test "$darwin" = "yes" ; then |
2681 | 5b0753e0 | bellard | echo "Cocoa support $cocoa" |
2682 | 5b0753e0 | bellard | fi |
2683 | 97a847bc | bellard | echo "SDL support $sdl" |
2684 | 4d3b6f6e | balrog | echo "curses support $curses" |
2685 | 769ce76d | Alexander Graf | echo "curl support $curl" |
2686 | 5495ed11 | Luiz Capitulino | echo "check support $check_utests" |
2687 | 67b915a5 | bellard | echo "mingw32 support $mingw32" |
2688 | 0c58ac1c | malc | echo "Audio drivers $audio_drv_list" |
2689 | 0c58ac1c | malc | echo "Extra audio cards $audio_card_list" |
2690 | eb852011 | Markus Armbruster | echo "Block whitelist $block_drv_whitelist" |
2691 | 8ff9cbf7 | malc | echo "Mixer emulation $mixemu" |
2692 | 821601ea | Jes Sorensen | echo "VNC support $vnc" |
2693 | 821601ea | Jes Sorensen | if test "$vnc" = "yes" ; then |
2694 | 821601ea | Jes Sorensen | echo "VNC TLS support $vnc_tls" |
2695 | 821601ea | Jes Sorensen | echo "VNC SASL support $vnc_sasl" |
2696 | 821601ea | Jes Sorensen | echo "VNC JPEG support $vnc_jpeg" |
2697 | 821601ea | Jes Sorensen | echo "VNC PNG support $vnc_png" |
2698 | 821601ea | Jes Sorensen | echo "VNC thread $vnc_thread" |
2699 | 821601ea | Jes Sorensen | fi |
2700 | 3142255c | blueswir1 | if test -n "$sparc_cpu"; then |
2701 | 3142255c | blueswir1 | echo "Target Sparc Arch $sparc_cpu" |
2702 | 3142255c | blueswir1 | fi |
2703 | e37630ca | aliguori | echo "xen support $xen" |
2704 | 2e4d9fb1 | aurel32 | echo "brlapi support $brlapi" |
2705 | a20a6f46 | Juan Quintela | echo "bluez support $bluez" |
2706 | a25dba17 | Juan Quintela | echo "Documentation $docs" |
2707 | c5937220 | pbrook | [ ! -z "$uname_release" ] && \ |
2708 | c5937220 | pbrook | echo "uname -r $uname_release" |
2709 | bd0c5661 | pbrook | echo "NPTL support $nptl" |
2710 | 379f6698 | Paul Brook | echo "GUEST_BASE $guest_base" |
2711 | 34005a00 | Kirill A. Shutemov | echo "PIE user targets $user_pie" |
2712 | 8a16d273 | ths | echo "vde support $vde" |
2713 | e5d355d1 | aliguori | echo "IO thread $io_thread" |
2714 | 5c6c3a6c | Christoph Hellwig | echo "Linux AIO support $linux_aio" |
2715 | 758e8e38 | Venkateswararao Jujjuri (JV) | echo "ATTR/XATTR support $attr" |
2716 | 77755340 | ths | echo "Install blobs $blobs" |
2717 | b31a0277 | Juan Quintela | echo "KVM support $kvm" |
2718 | f652e6af | aurel32 | echo "fdt support $fdt" |
2719 | ceb42de8 | aliguori | echo "preadv support $preadv" |
2720 | 5f6b9e8f | Blue Swirl | echo "fdatasync $fdatasync" |
2721 | e78815a5 | Andreas Färber | echo "madvise $madvise" |
2722 | e78815a5 | Andreas Färber | echo "posix_madvise $posix_madvise" |
2723 | ee682d27 | Stefan Weil | echo "uuid support $uuid" |
2724 | d5970055 | Michael S. Tsirkin | echo "vhost-net support $vhost_net" |
2725 | 94a420b1 | Stefan Hajnoczi | echo "Trace backend $trace_backend" |
2726 | 9410b56c | Prerna Saxena | echo "Trace output file $trace_file-<pid>" |
2727 | cd4ec0b4 | Gerd Hoffmann | echo "spice support $spice" |
2728 | f27aaf4b | Christian Brunner | echo "rbd support $rbd" |
2729 | dce512de | Christoph Hellwig | echo "xfsctl support $xfs" |
2730 | 111a38b0 | Robert Relyea | echo "nss used $smartcard_nss" |
2731 | 69354a83 | Hans de Goede | echo "usb net redir $usb_redir" |
2732 | 20ff075b | Michael Walle | echo "OpenGL support $opengl" |
2733 | d138cee9 | Michael Roth | echo "build guest agent $guest_agent" |
2734 | 67b915a5 | bellard | |
2735 | 1ba16968 | Stefan Weil | if test "$sdl_too_old" = "yes"; then |
2736 | 24b55b96 | bellard | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
2737 | 7c1f25b4 | bellard | fi |
2738 | 7d13299d | bellard | |
2739 | 98ec69ac | Juan Quintela | config_host_mak="config-host.mak" |
2740 | 4bf6b55b | Juan Quintela | config_host_ld="config-host.ld" |
2741 | 98ec69ac | Juan Quintela | |
2742 | 98ec69ac | Juan Quintela | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
2743 | 98ec69ac | Juan Quintela | printf "# Configured with:" >> $config_host_mak |
2744 | 98ec69ac | Juan Quintela | printf " '%s'" "$0" "$@" >> $config_host_mak |
2745 | 98ec69ac | Juan Quintela | echo >> $config_host_mak |
2746 | 98ec69ac | Juan Quintela | |
2747 | e6c3b0f7 | Paolo Bonzini | echo all: >> $config_host_mak |
2748 | 99d7cc75 | Paolo Bonzini | echo "prefix=$prefix" >> $config_host_mak |
2749 | 99d7cc75 | Paolo Bonzini | echo "bindir=$bindir" >> $config_host_mak |
2750 | 3aa5d2be | Alon Levy | echo "libdir=$libdir" >> $config_host_mak |
2751 | 0f94d6da | Alon Levy | echo "includedir=$includedir" >> $config_host_mak |
2752 | 99d7cc75 | Paolo Bonzini | echo "mandir=$mandir" >> $config_host_mak |
2753 | 99d7cc75 | Paolo Bonzini | echo "datadir=$datadir" >> $config_host_mak |
2754 | 99d7cc75 | Paolo Bonzini | echo "sysconfdir=$sysconfdir" >> $config_host_mak |
2755 | 99d7cc75 | Paolo Bonzini | echo "docdir=$docdir" >> $config_host_mak |
2756 | 1dabe05c | Paolo Bonzini | echo "confdir=$confdir" >> $config_host_mak |
2757 | 804edf29 | Juan Quintela | |
2758 | 2408a527 | aurel32 | case "$cpu" in |
2759 | d2fbca94 | Guan Xuetao | i386|x86_64|alpha|cris|hppa|ia64|lm32|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64|unicore32) |
2760 | e0da9dd3 | Juan Quintela | ARCH=$cpu |
2761 | 2408a527 | aurel32 | ;; |
2762 | a302c32d | Laurent Desnogues | armv4b|armv4l) |
2763 | 16dbd14f | Juan Quintela | ARCH=arm |
2764 | 2408a527 | aurel32 | ;; |
2765 | 2408a527 | aurel32 | esac |
2766 | 98ec69ac | Juan Quintela | echo "ARCH=$ARCH" >> $config_host_mak |
2767 | f8393946 | aurel32 | if test "$debug_tcg" = "yes" ; then |
2768 | 2358a494 | Juan Quintela | echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak |
2769 | f8393946 | aurel32 | fi |
2770 | b4475aa2 | Luiz Capitulino | if test "$debug_mon" = "yes" ; then |
2771 | b4475aa2 | Luiz Capitulino | echo "CONFIG_DEBUG_MONITOR=y" >> $config_host_mak |
2772 | b4475aa2 | Luiz Capitulino | fi |
2773 | f3d08ee6 | Paul Brook | if test "$debug" = "yes" ; then |
2774 | 2358a494 | Juan Quintela | echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak |
2775 | f3d08ee6 | Paul Brook | fi |
2776 | 1625af87 | aliguori | if test "$strip_opt" = "yes" ; then |
2777 | 52ba784d | Hollis Blanchard | echo "STRIP=${strip}" >> $config_host_mak |
2778 | 1625af87 | aliguori | fi |
2779 | 7d13299d | bellard | if test "$bigendian" = "yes" ; then |
2780 | e2542fe2 | Juan Quintela | echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak |
2781 | 97a847bc | bellard | fi |
2782 | 2358a494 | Juan Quintela | echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak |
2783 | 67b915a5 | bellard | if test "$mingw32" = "yes" ; then |
2784 | 98ec69ac | Juan Quintela | echo "CONFIG_WIN32=y" >> $config_host_mak |
2785 | 9fe6de94 | Blue Swirl | rc_version=`cat $source_path/VERSION` |
2786 | 9fe6de94 | Blue Swirl | version_major=${rc_version%%.*} |
2787 | 9fe6de94 | Blue Swirl | rc_version=${rc_version#*.} |
2788 | 9fe6de94 | Blue Swirl | version_minor=${rc_version%%.*} |
2789 | 9fe6de94 | Blue Swirl | rc_version=${rc_version#*.} |
2790 | 9fe6de94 | Blue Swirl | version_subminor=${rc_version%%.*} |
2791 | 9fe6de94 | Blue Swirl | version_micro=0 |
2792 | 9fe6de94 | Blue Swirl | echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak |
2793 | 9fe6de94 | Blue Swirl | echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak |
2794 | 210fa556 | pbrook | else |
2795 | 35f4df27 | Juan Quintela | echo "CONFIG_POSIX=y" >> $config_host_mak |
2796 | dffcb71c | Mark McLoughlin | fi |
2797 | dffcb71c | Mark McLoughlin | |
2798 | dffcb71c | Mark McLoughlin | if test "$linux" = "yes" ; then |
2799 | dffcb71c | Mark McLoughlin | echo "CONFIG_LINUX=y" >> $config_host_mak |
2800 | 67b915a5 | bellard | fi |
2801 | 128ab2ff | blueswir1 | |
2802 | 83fb7adf | bellard | if test "$darwin" = "yes" ; then |
2803 | 98ec69ac | Juan Quintela | echo "CONFIG_DARWIN=y" >> $config_host_mak |
2804 | 83fb7adf | bellard | fi |
2805 | b29fe3ed | malc | |
2806 | b29fe3ed | malc | if test "$aix" = "yes" ; then |
2807 | 98ec69ac | Juan Quintela | echo "CONFIG_AIX=y" >> $config_host_mak |
2808 | b29fe3ed | malc | fi |
2809 | b29fe3ed | malc | |
2810 | ec530c81 | bellard | if test "$solaris" = "yes" ; then |
2811 | 98ec69ac | Juan Quintela | echo "CONFIG_SOLARIS=y" >> $config_host_mak |
2812 | 2358a494 | Juan Quintela | echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak |
2813 | 0475a5ca | ths | if test "$needs_libsunmath" = "yes" ; then |
2814 | 75b5a697 | Juan Quintela | echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak |
2815 | 0475a5ca | ths | fi |
2816 | ec530c81 | bellard | fi |
2817 | 179cf400 | Andreas Färber | if test "$haiku" = "yes" ; then |
2818 | 179cf400 | Andreas Färber | echo "CONFIG_HAIKU=y" >> $config_host_mak |
2819 | 179cf400 | Andreas Färber | fi |
2820 | 97a847bc | bellard | if test "$static" = "yes" ; then |
2821 | 98ec69ac | Juan Quintela | echo "CONFIG_STATIC=y" >> $config_host_mak |
2822 | 7d13299d | bellard | fi |
2823 | 1ba16968 | Stefan Weil | if test "$profiler" = "yes" ; then |
2824 | 2358a494 | Juan Quintela | echo "CONFIG_PROFILER=y" >> $config_host_mak |
2825 | 05c2a3e7 | bellard | fi |
2826 | c20709aa | bellard | if test "$slirp" = "yes" ; then |
2827 | 98ec69ac | Juan Quintela | echo "CONFIG_SLIRP=y" >> $config_host_mak |
2828 | f9728943 | Paolo Bonzini | QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES" |
2829 | c20709aa | bellard | fi |
2830 | 8a16d273 | ths | if test "$vde" = "yes" ; then |
2831 | 98ec69ac | Juan Quintela | echo "CONFIG_VDE=y" >> $config_host_mak |
2832 | 8a16d273 | ths | fi |
2833 | 0c58ac1c | malc | for card in $audio_card_list; do |
2834 | f6e5889e | pbrook | def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'` |
2835 | 98ec69ac | Juan Quintela | echo "$def=y" >> $config_host_mak |
2836 | 0c58ac1c | malc | done |
2837 | 2358a494 | Juan Quintela | echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak |
2838 | 0c58ac1c | malc | for drv in $audio_drv_list; do |
2839 | f6e5889e | pbrook | def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'` |
2840 | 98ec69ac | Juan Quintela | echo "$def=y" >> $config_host_mak |
2841 | 923e4521 | malc | if test "$drv" = "fmod"; then |
2842 | 7aac6cb1 | Juan Quintela | echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak |
2843 | 0c58ac1c | malc | fi |
2844 | 0c58ac1c | malc | done |
2845 | 67f86e8e | Juan Quintela | if test "$audio_pt_int" = "yes" ; then |
2846 | 67f86e8e | Juan Quintela | echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak |
2847 | 67f86e8e | Juan Quintela | fi |
2848 | d5631638 | malc | if test "$audio_win_int" = "yes" ; then |
2849 | d5631638 | malc | echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak |
2850 | d5631638 | malc | fi |
2851 | eb852011 | Markus Armbruster | echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak |
2852 | 8ff9cbf7 | malc | if test "$mixemu" = "yes" ; then |
2853 | 98ec69ac | Juan Quintela | echo "CONFIG_MIXEMU=y" >> $config_host_mak |
2854 | 8ff9cbf7 | malc | fi |
2855 | 821601ea | Jes Sorensen | if test "$vnc" = "yes" ; then |
2856 | 821601ea | Jes Sorensen | echo "CONFIG_VNC=y" >> $config_host_mak |
2857 | 821601ea | Jes Sorensen | fi |
2858 | 8d5d2d4c | ths | if test "$vnc_tls" = "yes" ; then |
2859 | 98ec69ac | Juan Quintela | echo "CONFIG_VNC_TLS=y" >> $config_host_mak |
2860 | 525061bf | Juan Quintela | echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak |
2861 | 8d5d2d4c | ths | fi |
2862 | 2f9606b3 | aliguori | if test "$vnc_sasl" = "yes" ; then |
2863 | 98ec69ac | Juan Quintela | echo "CONFIG_VNC_SASL=y" >> $config_host_mak |
2864 | 60ddf533 | Juan Quintela | echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak |
2865 | 2f9606b3 | aliguori | fi |
2866 | 821601ea | Jes Sorensen | if test "$vnc_jpeg" = "yes" ; then |
2867 | 2f6f5c7a | Corentin Chary | echo "CONFIG_VNC_JPEG=y" >> $config_host_mak |
2868 | 2f6f5c7a | Corentin Chary | echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak |
2869 | 2f6f5c7a | Corentin Chary | fi |
2870 | 821601ea | Jes Sorensen | if test "$vnc_png" = "yes" ; then |
2871 | efe556ad | Corentin Chary | echo "CONFIG_VNC_PNG=y" >> $config_host_mak |
2872 | efe556ad | Corentin Chary | echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak |
2873 | efe556ad | Corentin Chary | fi |
2874 | 821601ea | Jes Sorensen | if test "$vnc_thread" = "yes" ; then |
2875 | bd023f95 | Corentin Chary | echo "CONFIG_VNC_THREAD=y" >> $config_host_mak |
2876 | bd023f95 | Corentin Chary | fi |
2877 | 76655d6d | aliguori | if test "$fnmatch" = "yes" ; then |
2878 | 2358a494 | Juan Quintela | echo "CONFIG_FNMATCH=y" >> $config_host_mak |
2879 | 76655d6d | aliguori | fi |
2880 | ee682d27 | Stefan Weil | if test "$uuid" = "yes" ; then |
2881 | ee682d27 | Stefan Weil | echo "CONFIG_UUID=y" >> $config_host_mak |
2882 | ee682d27 | Stefan Weil | fi |
2883 | dce512de | Christoph Hellwig | if test "$xfs" = "yes" ; then |
2884 | dce512de | Christoph Hellwig | echo "CONFIG_XFS=y" >> $config_host_mak |
2885 | dce512de | Christoph Hellwig | fi |
2886 | b1a550a0 | pbrook | qemu_version=`head $source_path/VERSION` |
2887 | 98ec69ac | Juan Quintela | echo "VERSION=$qemu_version" >>$config_host_mak |
2888 | 2358a494 | Juan Quintela | echo "PKGVERSION=$pkgversion" >>$config_host_mak |
2889 | 98ec69ac | Juan Quintela | echo "SRC_PATH=$source_path" >> $config_host_mak |
2890 | 98ec69ac | Juan Quintela | echo "TARGET_DIRS=$target_list" >> $config_host_mak |
2891 | a25dba17 | Juan Quintela | if [ "$docs" = "yes" ] ; then |
2892 | 98ec69ac | Juan Quintela | echo "BUILD_DOCS=yes" >> $config_host_mak |
2893 | cc8ae6de | pbrook | fi |
2894 | 1ac88f28 | Juan Quintela | if test "$sdl" = "yes" ; then |
2895 | 98ec69ac | Juan Quintela | echo "CONFIG_SDL=y" >> $config_host_mak |
2896 | 1ac88f28 | Juan Quintela | echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak |
2897 | 49ecc3fa | bellard | fi |
2898 | 49ecc3fa | bellard | if test "$cocoa" = "yes" ; then |
2899 | 98ec69ac | Juan Quintela | echo "CONFIG_COCOA=y" >> $config_host_mak |
2900 | 4d3b6f6e | balrog | fi |
2901 | 4d3b6f6e | balrog | if test "$curses" = "yes" ; then |
2902 | 98ec69ac | Juan Quintela | echo "CONFIG_CURSES=y" >> $config_host_mak |
2903 | 49ecc3fa | bellard | fi |
2904 | 3b3f24ad | aurel32 | if test "$atfile" = "yes" ; then |
2905 | 2358a494 | Juan Quintela | echo "CONFIG_ATFILE=y" >> $config_host_mak |
2906 | 3b3f24ad | aurel32 | fi |
2907 | ebc996f3 | Riku Voipio | if test "$utimens" = "yes" ; then |
2908 | 2358a494 | Juan Quintela | echo "CONFIG_UTIMENSAT=y" >> $config_host_mak |
2909 | ebc996f3 | Riku Voipio | fi |
2910 | 099d6b0f | Riku Voipio | if test "$pipe2" = "yes" ; then |
2911 | 2358a494 | Juan Quintela | echo "CONFIG_PIPE2=y" >> $config_host_mak |
2912 | 099d6b0f | Riku Voipio | fi |
2913 | 40ff6d7e | Kevin Wolf | if test "$accept4" = "yes" ; then |
2914 | 40ff6d7e | Kevin Wolf | echo "CONFIG_ACCEPT4=y" >> $config_host_mak |
2915 | 40ff6d7e | Kevin Wolf | fi |
2916 | 3ce34dfb | vibisreenivasan | if test "$splice" = "yes" ; then |
2917 | 2358a494 | Juan Quintela | echo "CONFIG_SPLICE=y" >> $config_host_mak |
2918 | 3ce34dfb | vibisreenivasan | fi |
2919 | c2882b96 | Riku Voipio | if test "$eventfd" = "yes" ; then |
2920 | c2882b96 | Riku Voipio | echo "CONFIG_EVENTFD=y" >> $config_host_mak |
2921 | c2882b96 | Riku Voipio | fi |
2922 | d0927938 | Ulrich Hecht | if test "$fallocate" = "yes" ; then |
2923 | d0927938 | Ulrich Hecht | echo "CONFIG_FALLOCATE=y" >> $config_host_mak |
2924 | d0927938 | Ulrich Hecht | fi |
2925 | c727f47d | Peter Maydell | if test "$sync_file_range" = "yes" ; then |
2926 | c727f47d | Peter Maydell | echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak |
2927 | c727f47d | Peter Maydell | fi |
2928 | dace20dc | Peter Maydell | if test "$fiemap" = "yes" ; then |
2929 | dace20dc | Peter Maydell | echo "CONFIG_FIEMAP=y" >> $config_host_mak |
2930 | dace20dc | Peter Maydell | fi |
2931 | d0927938 | Ulrich Hecht | if test "$dup3" = "yes" ; then |
2932 | d0927938 | Ulrich Hecht | echo "CONFIG_DUP3=y" >> $config_host_mak |
2933 | d0927938 | Ulrich Hecht | fi |
2934 | 3b6edd16 | Peter Maydell | if test "$epoll" = "yes" ; then |
2935 | 3b6edd16 | Peter Maydell | echo "CONFIG_EPOLL=y" >> $config_host_mak |
2936 | 3b6edd16 | Peter Maydell | fi |
2937 | 3b6edd16 | Peter Maydell | if test "$epoll_create1" = "yes" ; then |
2938 | 3b6edd16 | Peter Maydell | echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak |
2939 | 3b6edd16 | Peter Maydell | fi |
2940 | 3b6edd16 | Peter Maydell | if test "$epoll_pwait" = "yes" ; then |
2941 | 3b6edd16 | Peter Maydell | echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak |
2942 | 3b6edd16 | Peter Maydell | fi |
2943 | 3b3f24ad | aurel32 | if test "$inotify" = "yes" ; then |
2944 | 2358a494 | Juan Quintela | echo "CONFIG_INOTIFY=y" >> $config_host_mak |
2945 | 3b3f24ad | aurel32 | fi |
2946 | c05c7a73 | Riku Voipio | if test "$inotify1" = "yes" ; then |
2947 | c05c7a73 | Riku Voipio | echo "CONFIG_INOTIFY1=y" >> $config_host_mak |
2948 | c05c7a73 | Riku Voipio | fi |
2949 | 6ae9a1f4 | Juan Quintela | if test "$byteswap_h" = "yes" ; then |
2950 | 6ae9a1f4 | Juan Quintela | echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak |
2951 | 6ae9a1f4 | Juan Quintela | fi |
2952 | 6ae9a1f4 | Juan Quintela | if test "$bswap_h" = "yes" ; then |
2953 | 6ae9a1f4 | Juan Quintela | echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak |
2954 | 6ae9a1f4 | Juan Quintela | fi |
2955 | 769ce76d | Alexander Graf | if test "$curl" = "yes" ; then |
2956 | 98ec69ac | Juan Quintela | echo "CONFIG_CURL=y" >> $config_host_mak |
2957 | b1d5a277 | Juan Quintela | echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak |
2958 | 769ce76d | Alexander Graf | fi |
2959 | 2e4d9fb1 | aurel32 | if test "$brlapi" = "yes" ; then |
2960 | 98ec69ac | Juan Quintela | echo "CONFIG_BRLAPI=y" >> $config_host_mak |
2961 | 2e4d9fb1 | aurel32 | fi |
2962 | fb599c9a | balrog | if test "$bluez" = "yes" ; then |
2963 | 98ec69ac | Juan Quintela | echo "CONFIG_BLUEZ=y" >> $config_host_mak |
2964 | ef7635ec | Juan Quintela | echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak |
2965 | fb599c9a | balrog | fi |
2966 | e18df141 | Anthony Liguori | echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak |
2967 | e37630ca | aliguori | if test "$xen" = "yes" ; then |
2968 | 6dbd588a | Jan Kiszka | echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak |
2969 | d5b93ddf | Anthony PERARD | echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak |
2970 | e37630ca | aliguori | fi |
2971 | e5d355d1 | aliguori | if test "$io_thread" = "yes" ; then |
2972 | 98ec69ac | Juan Quintela | echo "CONFIG_IOTHREAD=y" >> $config_host_mak |
2973 | e5d355d1 | aliguori | fi |
2974 | 5c6c3a6c | Christoph Hellwig | if test "$linux_aio" = "yes" ; then |
2975 | 5c6c3a6c | Christoph Hellwig | echo "CONFIG_LINUX_AIO=y" >> $config_host_mak |
2976 | 5c6c3a6c | Christoph Hellwig | fi |
2977 | 758e8e38 | Venkateswararao Jujjuri (JV) | if test "$attr" = "yes" ; then |
2978 | 758e8e38 | Venkateswararao Jujjuri (JV) | echo "CONFIG_ATTR=y" >> $config_host_mak |
2979 | 758e8e38 | Venkateswararao Jujjuri (JV) | fi |
2980 | 758e8e38 | Venkateswararao Jujjuri (JV) | if test "$linux" = "yes" ; then |
2981 | 758e8e38 | Venkateswararao Jujjuri (JV) | if test "$attr" = "yes" ; then |
2982 | 758e8e38 | Venkateswararao Jujjuri (JV) | echo "CONFIG_VIRTFS=y" >> $config_host_mak |
2983 | 758e8e38 | Venkateswararao Jujjuri (JV) | fi |
2984 | 758e8e38 | Venkateswararao Jujjuri (JV) | fi |
2985 | 77755340 | ths | if test "$blobs" = "yes" ; then |
2986 | 98ec69ac | Juan Quintela | echo "INSTALL_BLOBS=yes" >> $config_host_mak |
2987 | 77755340 | ths | fi |
2988 | bf9298b9 | aliguori | if test "$iovec" = "yes" ; then |
2989 | 2358a494 | Juan Quintela | echo "CONFIG_IOVEC=y" >> $config_host_mak |
2990 | bf9298b9 | aliguori | fi |
2991 | ceb42de8 | aliguori | if test "$preadv" = "yes" ; then |
2992 | 2358a494 | Juan Quintela | echo "CONFIG_PREADV=y" >> $config_host_mak |
2993 | ceb42de8 | aliguori | fi |
2994 | f652e6af | aurel32 | if test "$fdt" = "yes" ; then |
2995 | 3f0855b1 | Juan Quintela | echo "CONFIG_FDT=y" >> $config_host_mak |
2996 | f652e6af | aurel32 | fi |
2997 | dcc38d1c | Marcelo Tosatti | if test "$signalfd" = "yes" ; then |
2998 | dcc38d1c | Marcelo Tosatti | echo "CONFIG_SIGNALFD=y" >> $config_host_mak |
2999 | dcc38d1c | Marcelo Tosatti | fi |
3000 | de5071c5 | Blue Swirl | if test "$need_offsetof" = "yes" ; then |
3001 | de5071c5 | Blue Swirl | echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak |
3002 | de5071c5 | Blue Swirl | fi |
3003 | 747bbdf7 | Blue Swirl | if test "$gcc_attribute_warn_unused_result" = "yes" ; then |
3004 | 747bbdf7 | Blue Swirl | echo "CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y" >> $config_host_mak |
3005 | 747bbdf7 | Blue Swirl | fi |
3006 | 5f6b9e8f | Blue Swirl | if test "$fdatasync" = "yes" ; then |
3007 | 5f6b9e8f | Blue Swirl | echo "CONFIG_FDATASYNC=y" >> $config_host_mak |
3008 | 5f6b9e8f | Blue Swirl | fi |
3009 | e78815a5 | Andreas Färber | if test "$madvise" = "yes" ; then |
3010 | e78815a5 | Andreas Färber | echo "CONFIG_MADVISE=y" >> $config_host_mak |
3011 | e78815a5 | Andreas Färber | fi |
3012 | e78815a5 | Andreas Färber | if test "$posix_madvise" = "yes" ; then |
3013 | e78815a5 | Andreas Färber | echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak |
3014 | e78815a5 | Andreas Färber | fi |
3015 | 97a847bc | bellard | |
3016 | cd4ec0b4 | Gerd Hoffmann | if test "$spice" = "yes" ; then |
3017 | cd4ec0b4 | Gerd Hoffmann | echo "CONFIG_SPICE=y" >> $config_host_mak |
3018 | cd4ec0b4 | Gerd Hoffmann | fi |
3019 | 36707144 | Alon Levy | |
3020 | 36707144 | Alon Levy | if test "$smartcard" = "yes" ; then |
3021 | 36707144 | Alon Levy | echo "CONFIG_SMARTCARD=y" >> $config_host_mak |
3022 | 36707144 | Alon Levy | fi |
3023 | cd4ec0b4 | Gerd Hoffmann | |
3024 | 111a38b0 | Robert Relyea | if test "$smartcard_nss" = "yes" ; then |
3025 | 111a38b0 | Robert Relyea | echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak |
3026 | 111a38b0 | Robert Relyea | fi |
3027 | 111a38b0 | Robert Relyea | |
3028 | 69354a83 | Hans de Goede | if test "$usb_redir" = "yes" ; then |
3029 | 69354a83 | Hans de Goede | echo "CONFIG_USB_REDIR=y" >> $config_host_mak |
3030 | 69354a83 | Hans de Goede | fi |
3031 | 69354a83 | Hans de Goede | |
3032 | 20ff075b | Michael Walle | if test "$opengl" = "yes" ; then |
3033 | 20ff075b | Michael Walle | echo "CONFIG_OPENGL=y" >> $config_host_mak |
3034 | 20ff075b | Michael Walle | fi |
3035 | 20ff075b | Michael Walle | |
3036 | 83fb7adf | bellard | # XXX: suppress that |
3037 | 7d3505c5 | bellard | if [ "$bsd" = "yes" ] ; then |
3038 | 2358a494 | Juan Quintela | echo "CONFIG_BSD=y" >> $config_host_mak |
3039 | 7d3505c5 | bellard | fi |
3040 | 7d3505c5 | bellard | |
3041 | 2358a494 | Juan Quintela | echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak |
3042 | c5937220 | pbrook | |
3043 | 20ff6c80 | Anthony Liguori | if test "$zero_malloc" = "yes" ; then |
3044 | 20ff6c80 | Anthony Liguori | echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak |
3045 | 20ff6c80 | Anthony Liguori | fi |
3046 | f27aaf4b | Christian Brunner | if test "$rbd" = "yes" ; then |
3047 | f27aaf4b | Christian Brunner | echo "CONFIG_RBD=y" >> $config_host_mak |
3048 | d0e2fce5 | Aneesh Kumar K.V | fi |
3049 | d0e2fce5 | Aneesh Kumar K.V | |
3050 | d0e2fce5 | Aneesh Kumar K.V | if test "$ucontext_coroutine" = "yes" ; then |
3051 | d0e2fce5 | Aneesh Kumar K.V | echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak |
3052 | f27aaf4b | Christian Brunner | fi |
3053 | 20ff6c80 | Anthony Liguori | |
3054 | 68063649 | blueswir1 | # USB host support |
3055 | 68063649 | blueswir1 | case "$usb" in |
3056 | 68063649 | blueswir1 | linux) |
3057 | 98ec69ac | Juan Quintela | echo "HOST_USB=linux" >> $config_host_mak |
3058 | 68063649 | blueswir1 | ;; |
3059 | 68063649 | blueswir1 | bsd) |
3060 | 98ec69ac | Juan Quintela | echo "HOST_USB=bsd" >> $config_host_mak |
3061 | 68063649 | blueswir1 | ;; |
3062 | 68063649 | blueswir1 | *) |
3063 | 98ec69ac | Juan Quintela | echo "HOST_USB=stub" >> $config_host_mak |
3064 | 68063649 | blueswir1 | ;; |
3065 | 68063649 | blueswir1 | esac |
3066 | 68063649 | blueswir1 | |
3067 | 94a420b1 | Stefan Hajnoczi | echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak |
3068 | 22890ab5 | Prerna Saxena | if test "$trace_backend" = "simple"; then |
3069 | 22890ab5 | Prerna Saxena | echo "CONFIG_SIMPLE_TRACE=y" >> $config_host_mak |
3070 | 22890ab5 | Prerna Saxena | fi |
3071 | 9410b56c | Prerna Saxena | # Set the appropriate trace file. |
3072 | 9410b56c | Prerna Saxena | if test "$trace_backend" = "simple"; then |
3073 | 953ffe0f | Andreas Färber | trace_file="\"$trace_file-\" FMT_pid" |
3074 | 9410b56c | Prerna Saxena | fi |
3075 | c276b17d | Daniel P. Berrange | if test "$trace_backend" = "dtrace" -a "$trace_backend_stap" = "yes" ; then |
3076 | c276b17d | Daniel P. Berrange | echo "CONFIG_SYSTEMTAP_TRACE=y" >> $config_host_mak |
3077 | c276b17d | Daniel P. Berrange | fi |
3078 | 9410b56c | Prerna Saxena | echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak |
3079 | 9410b56c | Prerna Saxena | |
3080 | 98ec69ac | Juan Quintela | echo "TOOLS=$tools" >> $config_host_mak |
3081 | 98ec69ac | Juan Quintela | echo "ROMS=$roms" >> $config_host_mak |
3082 | 804edf29 | Juan Quintela | echo "MAKE=$make" >> $config_host_mak |
3083 | 804edf29 | Juan Quintela | echo "INSTALL=$install" >> $config_host_mak |
3084 | 804edf29 | Juan Quintela | echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak |
3085 | 804edf29 | Juan Quintela | echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak |
3086 | 804edf29 | Juan Quintela | echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak |
3087 | c886edfb | Blue Swirl | echo "PYTHON=$python" >> $config_host_mak |
3088 | 804edf29 | Juan Quintela | echo "CC=$cc" >> $config_host_mak |
3089 | 2b2e59e6 | Paolo Bonzini | echo "CC_I386=$cc_i386" >> $config_host_mak |
3090 | 804edf29 | Juan Quintela | echo "HOST_CC=$host_cc" >> $config_host_mak |
3091 | 804edf29 | Juan Quintela | echo "AR=$ar" >> $config_host_mak |
3092 | 804edf29 | Juan Quintela | echo "OBJCOPY=$objcopy" >> $config_host_mak |
3093 | 804edf29 | Juan Quintela | echo "LD=$ld" >> $config_host_mak |
3094 | 9fe6de94 | Blue Swirl | echo "WINDRES=$windres" >> $config_host_mak |
3095 | 44dc0ca3 | Alon Levy | echo "LIBTOOL=$libtool" >> $config_host_mak |
3096 | e2a2ed06 | Juan Quintela | echo "CFLAGS=$CFLAGS" >> $config_host_mak |
3097 | a558ee17 | Juan Quintela | echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak |
3098 | f9728943 | Paolo Bonzini | echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak |
3099 | e39f0062 | Paolo Bonzini | if test "$sparse" = "yes" ; then |
3100 | e39f0062 | Paolo Bonzini | echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak |
3101 | e39f0062 | Paolo Bonzini | echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak |
3102 | e39f0062 | Paolo Bonzini | echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak |
3103 | e39f0062 | Paolo Bonzini | fi |
3104 | c81da56e | Juan Quintela | echo "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak |
3105 | e2a2ed06 | Juan Quintela | echo "LDFLAGS=$LDFLAGS" >> $config_host_mak |
3106 | a36abbbb | Juan Quintela | echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak |
3107 | a36abbbb | Juan Quintela | echo "ARLIBS_END=$arlibs_end" >> $config_host_mak |
3108 | 73da375e | Juan Quintela | echo "LIBS+=$LIBS" >> $config_host_mak |
3109 | 3e2e0e6b | Juan Quintela | echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak |
3110 | 804edf29 | Juan Quintela | echo "EXESUF=$EXESUF" >> $config_host_mak |
3111 | 957f1f99 | Michael Roth | echo "LIBS_QGA+=$libs_qga" >> $config_host_mak |
3112 | 804edf29 | Juan Quintela | |
3113 | 4bf6b55b | Juan Quintela | # generate list of library paths for linker script |
3114 | 4bf6b55b | Juan Quintela | |
3115 | 4bf6b55b | Juan Quintela | $ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld} |
3116 | 4bf6b55b | Juan Quintela | |
3117 | 4bf6b55b | Juan Quintela | if test -f ${config_host_ld}~ ; then |
3118 | 4bf6b55b | Juan Quintela | if cmp -s $config_host_ld ${config_host_ld}~ ; then |
3119 | 4bf6b55b | Juan Quintela | mv ${config_host_ld}~ $config_host_ld |
3120 | 4bf6b55b | Juan Quintela | else |
3121 | 4bf6b55b | Juan Quintela | rm ${config_host_ld}~ |
3122 | 4bf6b55b | Juan Quintela | fi |
3123 | 4bf6b55b | Juan Quintela | fi |
3124 | 4bf6b55b | Juan Quintela | |
3125 | 4d904533 | Blue Swirl | for d in libdis libdis-user; do |
3126 | 4d904533 | Blue Swirl | mkdir -p $d |
3127 | 11568d6d | Paolo Bonzini | symlink $source_path/Makefile.dis $d/Makefile |
3128 | 4d904533 | Blue Swirl | echo > $d/config.mak |
3129 | 4d904533 | Blue Swirl | done |
3130 | d44cff22 | Richard Henderson | if test "$static" = "no" -a "$user_pie" = "yes" ; then |
3131 | d44cff22 | Richard Henderson | echo "QEMU_CFLAGS+=-fpie" > libdis-user/config.mak |
3132 | d44cff22 | Richard Henderson | fi |
3133 | 4d904533 | Blue Swirl | |
3134 | 1d14ffa9 | bellard | for target in $target_list; do |
3135 | 97a847bc | bellard | target_dir="$target" |
3136 | 25be210f | Juan Quintela | config_target_mak=$target_dir/config-target.mak |
3137 | 600309b6 | Blue Swirl | target_arch2=`echo $target | cut -d '-' -f 1` |
3138 | 97a847bc | bellard | target_bigendian="no" |
3139 | 1f3d3c8f | Juan Quintela | |
3140 | ea2d6a39 | Juan Quintela | case "$target_arch2" in |
3141 | 613a22c9 | Michael Walle | armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus) |
3142 | ea2d6a39 | Juan Quintela | target_bigendian=yes |
3143 | ea2d6a39 | Juan Quintela | ;; |
3144 | ea2d6a39 | Juan Quintela | esac |
3145 | 97a847bc | bellard | target_softmmu="no" |
3146 | 997344f3 | bellard | target_user_only="no" |
3147 | 831b7825 | ths | target_linux_user="no" |
3148 | 831b7825 | ths | target_darwin_user="no" |
3149 | 84778508 | blueswir1 | target_bsd_user="no" |
3150 | 9e407a85 | pbrook | case "$target" in |
3151 | 600309b6 | Blue Swirl | ${target_arch2}-softmmu) |
3152 | 9e407a85 | pbrook | target_softmmu="yes" |
3153 | 9e407a85 | pbrook | ;; |
3154 | 600309b6 | Blue Swirl | ${target_arch2}-linux-user) |
3155 | 9c7a4202 | Blue Swirl | if test "$linux" != "yes" ; then |
3156 | 9c7a4202 | Blue Swirl | echo "ERROR: Target '$target' is only available on a Linux host" |
3157 | 9c7a4202 | Blue Swirl | exit 1 |
3158 | 9c7a4202 | Blue Swirl | fi |
3159 | 9e407a85 | pbrook | target_user_only="yes" |
3160 | 9e407a85 | pbrook | target_linux_user="yes" |
3161 | 9e407a85 | pbrook | ;; |
3162 | 600309b6 | Blue Swirl | ${target_arch2}-darwin-user) |
3163 | 9c7a4202 | Blue Swirl | if test "$darwin" != "yes" ; then |
3164 | 9c7a4202 | Blue Swirl | echo "ERROR: Target '$target' is only available on a Darwin host" |
3165 | 9c7a4202 | Blue Swirl | exit 1 |
3166 | 9c7a4202 | Blue Swirl | fi |
3167 | 9e407a85 | pbrook | target_user_only="yes" |
3168 | 9e407a85 | pbrook | target_darwin_user="yes" |
3169 | 9e407a85 | pbrook | ;; |
3170 | 600309b6 | Blue Swirl | ${target_arch2}-bsd-user) |
3171 | 9cf55765 | Blue Swirl | if test "$bsd" != "yes" ; then |
3172 | 9c7a4202 | Blue Swirl | echo "ERROR: Target '$target' is only available on a BSD host" |
3173 | 9c7a4202 | Blue Swirl | exit 1 |
3174 | 9c7a4202 | Blue Swirl | fi |
3175 | 84778508 | blueswir1 | target_user_only="yes" |
3176 | 84778508 | blueswir1 | target_bsd_user="yes" |
3177 | 84778508 | blueswir1 | ;; |
3178 | 9e407a85 | pbrook | *) |
3179 | 9e407a85 | pbrook | echo "ERROR: Target '$target' not recognised" |
3180 | 9e407a85 | pbrook | exit 1 |
3181 | 9e407a85 | pbrook | ;; |
3182 | 9e407a85 | pbrook | esac |
3183 | 831b7825 | ths | |
3184 | 97a847bc | bellard | mkdir -p $target_dir |
3185 | 158142c2 | bellard | mkdir -p $target_dir/fpu |
3186 | 57fec1fe | bellard | mkdir -p $target_dir/tcg |
3187 | 59f2a787 | Gerd Hoffmann | mkdir -p $target_dir/ide |
3188 | 353ac78d | Aneesh Kumar K.V | mkdir -p $target_dir/9pfs |
3189 | 84778508 | blueswir1 | if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then |
3190 | 69de927c | bellard | mkdir -p $target_dir/nwfpe |
3191 | 69de927c | bellard | fi |
3192 | 11568d6d | Paolo Bonzini | symlink $source_path/Makefile.target $target_dir/Makefile |
3193 | ec530c81 | bellard | |
3194 | 97a847bc | bellard | |
3195 | 25be210f | Juan Quintela | echo "# Automatically generated by configure - do not modify" > $config_target_mak |
3196 | de83cd02 | bellard | |
3197 | e5fe0c52 | pbrook | bflt="no" |
3198 | bd0c5661 | pbrook | target_nptl="no" |
3199 | 600309b6 | Blue Swirl | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"` |
3200 | 7ee2822c | Paolo Bonzini | echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak |
3201 | 56aebc89 | pbrook | gdb_xml_files="" |
3202 | c2e3dee6 | Laurent Vivier | target_short_alignment=2 |
3203 | c2e3dee6 | Laurent Vivier | target_int_alignment=4 |
3204 | c2e3dee6 | Laurent Vivier | target_long_alignment=4 |
3205 | c2e3dee6 | Laurent Vivier | target_llong_alignment=8 |
3206 | de3a354a | Michael Walle | target_libs_softmmu= |
3207 | 7ba1e619 | aliguori | |
3208 | 938b1edd | Juan Quintela | TARGET_ARCH="$target_arch2" |
3209 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH="" |
3210 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR="" |
3211 | e73aae67 | Juan Quintela | |
3212 | 600309b6 | Blue Swirl | case "$target_arch2" in |
3213 | 2408a527 | aurel32 | i386) |
3214 | 71deff27 | Aurelien Jarno | target_phys_bits=64 |
3215 | 2408a527 | aurel32 | ;; |
3216 | 2408a527 | aurel32 | x86_64) |
3217 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=i386 |
3218 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3219 | c2e3dee6 | Laurent Vivier | target_long_alignment=8 |
3220 | 2408a527 | aurel32 | ;; |
3221 | 2408a527 | aurel32 | alpha) |
3222 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3223 | c2e3dee6 | Laurent Vivier | target_long_alignment=8 |
3224 | a4b388ff | Richard Henderson | target_nptl="yes" |
3225 | 2408a527 | aurel32 | ;; |
3226 | 2408a527 | aurel32 | arm|armeb) |
3227 | b498c8a0 | Juan Quintela | TARGET_ARCH=arm |
3228 | 2408a527 | aurel32 | bflt="yes" |
3229 | bd0c5661 | pbrook | target_nptl="yes" |
3230 | 56aebc89 | pbrook | gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" |
3231 | 1ad2134f | Paul Brook | target_phys_bits=32 |
3232 | c2e3dee6 | Laurent Vivier | target_llong_alignment=4 |
3233 | 2408a527 | aurel32 | ;; |
3234 | 2408a527 | aurel32 | cris) |
3235 | 253bd7f8 | edgar_igl | target_nptl="yes" |
3236 | 1ad2134f | Paul Brook | target_phys_bits=32 |
3237 | 2408a527 | aurel32 | ;; |
3238 | 613a22c9 | Michael Walle | lm32) |
3239 | 613a22c9 | Michael Walle | target_phys_bits=32 |
3240 | de3a354a | Michael Walle | target_libs_softmmu="$opengl_libs" |
3241 | 613a22c9 | Michael Walle | ;; |
3242 | 2408a527 | aurel32 | m68k) |
3243 | 2408a527 | aurel32 | bflt="yes" |
3244 | 56aebc89 | pbrook | gdb_xml_files="cf-core.xml cf-fp.xml" |
3245 | 1ad2134f | Paul Brook | target_phys_bits=32 |
3246 | c2e3dee6 | Laurent Vivier | target_int_alignment=2 |
3247 | c2e3dee6 | Laurent Vivier | target_long_alignment=2 |
3248 | c2e3dee6 | Laurent Vivier | target_llong_alignment=2 |
3249 | 2408a527 | aurel32 | ;; |
3250 | 877fdc12 | Edgar E. Iglesias | microblaze|microblazeel) |
3251 | 877fdc12 | Edgar E. Iglesias | TARGET_ARCH=microblaze |
3252 | 72b675ca | Edgar E. Iglesias | bflt="yes" |
3253 | 72b675ca | Edgar E. Iglesias | target_nptl="yes" |
3254 | 72b675ca | Edgar E. Iglesias | target_phys_bits=32 |
3255 | de3a354a | Michael Walle | target_libs_softmmu="$fdt_libs" |
3256 | 72b675ca | Edgar E. Iglesias | ;; |
3257 | 0adcffb1 | Juan Quintela | mips|mipsel) |
3258 | b498c8a0 | Juan Quintela | TARGET_ARCH=mips |
3259 | 25be210f | Juan Quintela | echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak |
3260 | f04dc72f | Paul Brook | target_nptl="yes" |
3261 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3262 | 2408a527 | aurel32 | ;; |
3263 | 2408a527 | aurel32 | mipsn32|mipsn32el) |
3264 | b498c8a0 | Juan Quintela | TARGET_ARCH=mipsn32 |
3265 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=mips |
3266 | 25be210f | Juan Quintela | echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak |
3267 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3268 | 2408a527 | aurel32 | ;; |
3269 | 2408a527 | aurel32 | mips64|mips64el) |
3270 | b498c8a0 | Juan Quintela | TARGET_ARCH=mips64 |
3271 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=mips |
3272 | 25be210f | Juan Quintela | echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak |
3273 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3274 | c2e3dee6 | Laurent Vivier | target_long_alignment=8 |
3275 | 2408a527 | aurel32 | ;; |
3276 | 2408a527 | aurel32 | ppc) |
3277 | c8b3532d | aurel32 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
3278 | 1ad2134f | Paul Brook | target_phys_bits=32 |
3279 | d6630708 | Nathan Froyd | target_nptl="yes" |
3280 | de3a354a | Michael Walle | target_libs_softmmu="$fdt_libs" |
3281 | 2408a527 | aurel32 | ;; |
3282 | 2408a527 | aurel32 | ppcemb) |
3283 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=ppc |
3284 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=ppc |
3285 | c8b3532d | aurel32 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
3286 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3287 | d6630708 | Nathan Froyd | target_nptl="yes" |
3288 | de3a354a | Michael Walle | target_libs_softmmu="$fdt_libs" |
3289 | 2408a527 | aurel32 | ;; |
3290 | 2408a527 | aurel32 | ppc64) |
3291 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=ppc |
3292 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=ppc |
3293 | c8b3532d | aurel32 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
3294 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3295 | c2e3dee6 | Laurent Vivier | target_long_alignment=8 |
3296 | de3a354a | Michael Walle | target_libs_softmmu="$fdt_libs" |
3297 | 2408a527 | aurel32 | ;; |
3298 | 2408a527 | aurel32 | ppc64abi32) |
3299 | b498c8a0 | Juan Quintela | TARGET_ARCH=ppc64 |
3300 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=ppc |
3301 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=ppc |
3302 | 25be210f | Juan Quintela | echo "TARGET_ABI32=y" >> $config_target_mak |
3303 | c8b3532d | aurel32 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
3304 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3305 | de3a354a | Michael Walle | target_libs_softmmu="$fdt_libs" |
3306 | 2408a527 | aurel32 | ;; |
3307 | 2408a527 | aurel32 | sh4|sh4eb) |
3308 | b498c8a0 | Juan Quintela | TARGET_ARCH=sh4 |
3309 | 2408a527 | aurel32 | bflt="yes" |
3310 | 0b6d3ae0 | aurel32 | target_nptl="yes" |
3311 | 1ad2134f | Paul Brook | target_phys_bits=32 |
3312 | 2408a527 | aurel32 | ;; |
3313 | 2408a527 | aurel32 | sparc) |
3314 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3315 | 2408a527 | aurel32 | ;; |
3316 | 2408a527 | aurel32 | sparc64) |
3317 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=sparc |
3318 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3319 | c2e3dee6 | Laurent Vivier | target_long_alignment=8 |
3320 | 2408a527 | aurel32 | ;; |
3321 | 2408a527 | aurel32 | sparc32plus) |
3322 | b498c8a0 | Juan Quintela | TARGET_ARCH=sparc64 |
3323 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=sparc |
3324 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=sparc |
3325 | 25be210f | Juan Quintela | echo "TARGET_ABI32=y" >> $config_target_mak |
3326 | 1ad2134f | Paul Brook | target_phys_bits=64 |
3327 | 2408a527 | aurel32 | ;; |
3328 | 24e804ec | Alexander Graf | s390x) |
3329 | bc434676 | Ulrich Hecht | target_nptl="yes" |
3330 | 24e804ec | Alexander Graf | target_phys_bits=64 |
3331 | 7b3da903 | Alexander Graf | target_long_alignment=8 |
3332 | 24e804ec | Alexander Graf | ;; |
3333 | d2fbca94 | Guan Xuetao | unicore32) |
3334 | d2fbca94 | Guan Xuetao | target_phys_bits=32 |
3335 | d2fbca94 | Guan Xuetao | ;; |
3336 | 2408a527 | aurel32 | *) |
3337 | 2408a527 | aurel32 | echo "Unsupported target CPU" |
3338 | 2408a527 | aurel32 | exit 1 |
3339 | 2408a527 | aurel32 | ;; |
3340 | 2408a527 | aurel32 | esac |
3341 | c2e3dee6 | Laurent Vivier | echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak |
3342 | c2e3dee6 | Laurent Vivier | echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak |
3343 | c2e3dee6 | Laurent Vivier | echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak |
3344 | c2e3dee6 | Laurent Vivier | echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak |
3345 | 25be210f | Juan Quintela | echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak |
3346 | 053dd92e | Juan Quintela | target_arch_name="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`" |
3347 | 25be210f | Juan Quintela | echo "TARGET_$target_arch_name=y" >> $config_target_mak |
3348 | 25be210f | Juan Quintela | echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak |
3349 | 42bc608b | Juan Quintela | # TARGET_BASE_ARCH needs to be defined after TARGET_ARCH |
3350 | 6acff7da | Juan Quintela | if [ "$TARGET_BASE_ARCH" = "" ]; then |
3351 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=$TARGET_ARCH |
3352 | 6acff7da | Juan Quintela | fi |
3353 | 25be210f | Juan Quintela | echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak |
3354 | e6e91b9c | Juan Quintela | if [ "$TARGET_ABI_DIR" = "" ]; then |
3355 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=$TARGET_ARCH |
3356 | e6e91b9c | Juan Quintela | fi |
3357 | 25be210f | Juan Quintela | echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak |
3358 | 1b0c87fc | Juan Quintela | case "$target_arch2" in |
3359 | 1b0c87fc | Juan Quintela | i386|x86_64) |
3360 | 1b0c87fc | Juan Quintela | if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then |
3361 | 64b3cfdb | Anthony PERARD | target_phys_bits=64 |
3362 | 25be210f | Juan Quintela | echo "CONFIG_XEN=y" >> $config_target_mak |
3363 | 59d21e53 | Alexander Graf | else |
3364 | 59d21e53 | Alexander Graf | echo "CONFIG_NO_XEN=y" >> $config_target_mak |
3365 | 1b0c87fc | Juan Quintela | fi |
3366 | 59d21e53 | Alexander Graf | ;; |
3367 | 59d21e53 | Alexander Graf | *) |
3368 | 59d21e53 | Alexander Graf | echo "CONFIG_NO_XEN=y" >> $config_target_mak |
3369 | 1b0c87fc | Juan Quintela | esac |
3370 | c59249f9 | Juan Quintela | case "$target_arch2" in |
3371 | 0e60a699 | Alexander Graf | i386|x86_64|ppcemb|ppc|ppc64|s390x) |
3372 | c59249f9 | Juan Quintela | # Make sure the target and host cpus are compatible |
3373 | c59249f9 | Juan Quintela | if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ |
3374 | c59249f9 | Juan Quintela | \( "$target_arch2" = "$cpu" -o \ |
3375 | c59249f9 | Juan Quintela | \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \ |
3376 | 5f114bc6 | Alexander Graf | \( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \) -o \ |
3377 | adf82011 | René Rebe | \( "$target_arch2" = "ppc" -a "$cpu" = "ppc64" \) -o \ |
3378 | adf82011 | René Rebe | \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc64" \) -o \ |
3379 | c59249f9 | Juan Quintela | \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \ |
3380 | c59249f9 | Juan Quintela | \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then |
3381 | 25be210f | Juan Quintela | echo "CONFIG_KVM=y" >> $config_target_mak |
3382 | 1ba16968 | Stefan Weil | if test "$vhost_net" = "yes" ; then |
3383 | d5970055 | Michael S. Tsirkin | echo "CONFIG_VHOST_NET=y" >> $config_target_mak |
3384 | d5970055 | Michael S. Tsirkin | fi |
3385 | c59249f9 | Juan Quintela | fi |
3386 | c59249f9 | Juan Quintela | esac |
3387 | de83cd02 | bellard | if test "$target_bigendian" = "yes" ; then |
3388 | 25be210f | Juan Quintela | echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak |
3389 | de83cd02 | bellard | fi |
3390 | 97a847bc | bellard | if test "$target_softmmu" = "yes" ; then |
3391 | b1aa27c4 | Paul Brook | echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak |
3392 | 25be210f | Juan Quintela | echo "CONFIG_SOFTMMU=y" >> $config_target_mak |
3393 | de3a354a | Michael Walle | echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak |
3394 | 0e8c9214 | Andreas Färber | echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak |
3395 | 5791f45b | Kirill A. Shutemov | echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak |
3396 | 43ce4dfe | bellard | fi |
3397 | 997344f3 | bellard | if test "$target_user_only" = "yes" ; then |
3398 | 25be210f | Juan Quintela | echo "CONFIG_USER_ONLY=y" >> $config_target_mak |
3399 | 997344f3 | bellard | fi |
3400 | 831b7825 | ths | if test "$target_linux_user" = "yes" ; then |
3401 | 25be210f | Juan Quintela | echo "CONFIG_LINUX_USER=y" >> $config_target_mak |
3402 | 831b7825 | ths | fi |
3403 | 831b7825 | ths | if test "$target_darwin_user" = "yes" ; then |
3404 | 25be210f | Juan Quintela | echo "CONFIG_DARWIN_USER=y" >> $config_target_mak |
3405 | 831b7825 | ths | fi |
3406 | 111a38b0 | Robert Relyea | if test "$smartcard_nss" = "yes" ; then |
3407 | 111a38b0 | Robert Relyea | echo "subdir-$target: subdir-libcacard" >> $config_host_mak |
3408 | 111a38b0 | Robert Relyea | echo "libcacard_libs=$libcacard_libs" >> $config_host_mak |
3409 | 111a38b0 | Robert Relyea | echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak |
3410 | 111a38b0 | Robert Relyea | fi |
3411 | 56aebc89 | pbrook | list="" |
3412 | 56aebc89 | pbrook | if test ! -z "$gdb_xml_files" ; then |
3413 | 56aebc89 | pbrook | for x in $gdb_xml_files; do |
3414 | 56aebc89 | pbrook | list="$list $source_path/gdb-xml/$x" |
3415 | 56aebc89 | pbrook | done |
3416 | 3d0f1517 | Juan Quintela | echo "TARGET_XML_FILES=$list" >> $config_target_mak |
3417 | 56aebc89 | pbrook | fi |
3418 | 97a847bc | bellard | |
3419 | e5fe0c52 | pbrook | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
3420 | 25be210f | Juan Quintela | echo "TARGET_HAS_BFLT=y" >> $config_target_mak |
3421 | e5fe0c52 | pbrook | fi |
3422 | bd0c5661 | pbrook | if test "$target_user_only" = "yes" \ |
3423 | bd0c5661 | pbrook | -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then |
3424 | 25be210f | Juan Quintela | echo "CONFIG_USE_NPTL=y" >> $config_target_mak |
3425 | bd0c5661 | pbrook | fi |
3426 | 379f6698 | Paul Brook | if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then |
3427 | 25be210f | Juan Quintela | echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak |
3428 | 379f6698 | Paul Brook | fi |
3429 | 84778508 | blueswir1 | if test "$target_bsd_user" = "yes" ; then |
3430 | 25be210f | Juan Quintela | echo "CONFIG_BSD_USER=y" >> $config_target_mak |
3431 | 84778508 | blueswir1 | fi |
3432 | 5b0753e0 | bellard | |
3433 | 4afddb55 | Juan Quintela | # generate QEMU_CFLAGS/LDFLAGS for targets |
3434 | fa282484 | Juan Quintela | |
3435 | 4afddb55 | Juan Quintela | cflags="" |
3436 | f9728943 | Paolo Bonzini | includes="" |
3437 | fa282484 | Juan Quintela | ldflags="" |
3438 | 9b8e111f | Juan Quintela | |
3439 | 57ddfbf7 | Juan Quintela | if test "$ARCH" = "sparc64" ; then |
3440 | f9728943 | Paolo Bonzini | includes="-I\$(SRC_PATH)/tcg/sparc $includes" |
3441 | 24e804ec | Alexander Graf | elif test "$ARCH" = "s390x" ; then |
3442 | f9728943 | Paolo Bonzini | includes="-I\$(SRC_PATH)/tcg/s390 $includes" |
3443 | 5d8a4f8f | Richard Henderson | elif test "$ARCH" = "x86_64" ; then |
3444 | f9728943 | Paolo Bonzini | includes="-I\$(SRC_PATH)/tcg/i386 $includes" |
3445 | 57ddfbf7 | Juan Quintela | else |
3446 | f9728943 | Paolo Bonzini | includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes" |
3447 | 57ddfbf7 | Juan Quintela | fi |
3448 | f9728943 | Paolo Bonzini | includes="-I\$(SRC_PATH)/tcg $includes" |
3449 | 57ddfbf7 | Juan Quintela | |
3450 | 4d904533 | Blue Swirl | if test "$target_user_only" = "yes" ; then |
3451 | 4d904533 | Blue Swirl | libdis_config_mak=libdis-user/config.mak |
3452 | 4d904533 | Blue Swirl | else |
3453 | 4d904533 | Blue Swirl | libdis_config_mak=libdis/config.mak |
3454 | 4d904533 | Blue Swirl | fi |
3455 | 4d904533 | Blue Swirl | |
3456 | 64656024 | Juan Quintela | for i in $ARCH $TARGET_BASE_ARCH ; do |
3457 | 64656024 | Juan Quintela | case "$i" in |
3458 | 64656024 | Juan Quintela | alpha) |
3459 | 25be210f | Juan Quintela | echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak |
3460 | 4d904533 | Blue Swirl | echo "CONFIG_ALPHA_DIS=y" >> $libdis_config_mak |
3461 | 64656024 | Juan Quintela | ;; |
3462 | 64656024 | Juan Quintela | arm) |
3463 | 25be210f | Juan Quintela | echo "CONFIG_ARM_DIS=y" >> $config_target_mak |
3464 | 4d904533 | Blue Swirl | echo "CONFIG_ARM_DIS=y" >> $libdis_config_mak |
3465 | 64656024 | Juan Quintela | ;; |
3466 | 64656024 | Juan Quintela | cris) |
3467 | 25be210f | Juan Quintela | echo "CONFIG_CRIS_DIS=y" >> $config_target_mak |
3468 | 4d904533 | Blue Swirl | echo "CONFIG_CRIS_DIS=y" >> $libdis_config_mak |
3469 | 64656024 | Juan Quintela | ;; |
3470 | 64656024 | Juan Quintela | hppa) |
3471 | 25be210f | Juan Quintela | echo "CONFIG_HPPA_DIS=y" >> $config_target_mak |
3472 | 4d904533 | Blue Swirl | echo "CONFIG_HPPA_DIS=y" >> $libdis_config_mak |
3473 | 64656024 | Juan Quintela | ;; |
3474 | 64656024 | Juan Quintela | i386|x86_64) |
3475 | 25be210f | Juan Quintela | echo "CONFIG_I386_DIS=y" >> $config_target_mak |
3476 | 4d904533 | Blue Swirl | echo "CONFIG_I386_DIS=y" >> $libdis_config_mak |
3477 | 64656024 | Juan Quintela | ;; |
3478 | 903ec55c | Aurelien Jarno | ia64*) |
3479 | 903ec55c | Aurelien Jarno | echo "CONFIG_IA64_DIS=y" >> $config_target_mak |
3480 | 903ec55c | Aurelien Jarno | echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak |
3481 | 903ec55c | Aurelien Jarno | ;; |
3482 | 64656024 | Juan Quintela | m68k) |
3483 | 25be210f | Juan Quintela | echo "CONFIG_M68K_DIS=y" >> $config_target_mak |
3484 | 4d904533 | Blue Swirl | echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak |
3485 | 64656024 | Juan Quintela | ;; |
3486 | 877fdc12 | Edgar E. Iglesias | microblaze*) |
3487 | 25be210f | Juan Quintela | echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak |
3488 | 4d904533 | Blue Swirl | echo "CONFIG_MICROBLAZE_DIS=y" >> $libdis_config_mak |
3489 | 64656024 | Juan Quintela | ;; |
3490 | 64656024 | Juan Quintela | mips*) |
3491 | 25be210f | Juan Quintela | echo "CONFIG_MIPS_DIS=y" >> $config_target_mak |
3492 | 4d904533 | Blue Swirl | echo "CONFIG_MIPS_DIS=y" >> $libdis_config_mak |
3493 | 64656024 | Juan Quintela | ;; |
3494 | 64656024 | Juan Quintela | ppc*) |
3495 | 25be210f | Juan Quintela | echo "CONFIG_PPC_DIS=y" >> $config_target_mak |
3496 | 4d904533 | Blue Swirl | echo "CONFIG_PPC_DIS=y" >> $libdis_config_mak |
3497 | 64656024 | Juan Quintela | ;; |
3498 | 24e804ec | Alexander Graf | s390*) |
3499 | 25be210f | Juan Quintela | echo "CONFIG_S390_DIS=y" >> $config_target_mak |
3500 | 4d904533 | Blue Swirl | echo "CONFIG_S390_DIS=y" >> $libdis_config_mak |
3501 | 64656024 | Juan Quintela | ;; |
3502 | 64656024 | Juan Quintela | sh4) |
3503 | 25be210f | Juan Quintela | echo "CONFIG_SH4_DIS=y" >> $config_target_mak |
3504 | 4d904533 | Blue Swirl | echo "CONFIG_SH4_DIS=y" >> $libdis_config_mak |
3505 | 64656024 | Juan Quintela | ;; |
3506 | 64656024 | Juan Quintela | sparc*) |
3507 | 25be210f | Juan Quintela | echo "CONFIG_SPARC_DIS=y" >> $config_target_mak |
3508 | 4d904533 | Blue Swirl | echo "CONFIG_SPARC_DIS=y" >> $libdis_config_mak |
3509 | 64656024 | Juan Quintela | ;; |
3510 | 64656024 | Juan Quintela | esac |
3511 | 64656024 | Juan Quintela | done |
3512 | 64656024 | Juan Quintela | |
3513 | 6ee7126f | Juan Quintela | case "$ARCH" in |
3514 | 6ee7126f | Juan Quintela | alpha) |
3515 | 6ee7126f | Juan Quintela | # Ensure there's only a single GP |
3516 | 6ee7126f | Juan Quintela | cflags="-msmall-data $cflags" |
3517 | 6ee7126f | Juan Quintela | ;; |
3518 | 6ee7126f | Juan Quintela | esac |
3519 | 6ee7126f | Juan Quintela | |
3520 | 55d9c04b | Juan Quintela | if test "$target_softmmu" = "yes" ; then |
3521 | 55d9c04b | Juan Quintela | case "$TARGET_BASE_ARCH" in |
3522 | 55d9c04b | Juan Quintela | arm) |
3523 | 55d9c04b | Juan Quintela | cflags="-DHAS_AUDIO $cflags" |
3524 | 25a8bb96 | Michael Walle | ;; |
3525 | 25a8bb96 | Michael Walle | lm32) |
3526 | 25a8bb96 | Michael Walle | cflags="-DHAS_AUDIO $cflags" |
3527 | 55d9c04b | Juan Quintela | ;; |
3528 | 55d9c04b | Juan Quintela | i386|mips|ppc) |
3529 | 55d9c04b | Juan Quintela | cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags" |
3530 | 55d9c04b | Juan Quintela | ;; |
3531 | 55d9c04b | Juan Quintela | esac |
3532 | 55d9c04b | Juan Quintela | fi |
3533 | 55d9c04b | Juan Quintela | |
3534 | 34005a00 | Kirill A. Shutemov | if test "$target_user_only" = "yes" -a "$static" = "no" -a \ |
3535 | 50108930 | Blue Swirl | "$user_pie" = "yes" ; then |
3536 | 34005a00 | Kirill A. Shutemov | cflags="-fpie $cflags" |
3537 | 34005a00 | Kirill A. Shutemov | ldflags="-pie $ldflags" |
3538 | 34005a00 | Kirill A. Shutemov | fi |
3539 | 34005a00 | Kirill A. Shutemov | |
3540 | 471857dd | Juan Quintela | if test "$target_softmmu" = "yes" -a \( \ |
3541 | 471857dd | Juan Quintela | "$TARGET_ARCH" = "microblaze" -o \ |
3542 | 471857dd | Juan Quintela | "$TARGET_ARCH" = "cris" \) ; then |
3543 | 25be210f | Juan Quintela | echo "CONFIG_NEED_MMU=y" >> $config_target_mak |
3544 | 471857dd | Juan Quintela | fi |
3545 | 471857dd | Juan Quintela | |
3546 | d02c1db3 | Juan Quintela | if test "$gprof" = "yes" ; then |
3547 | 25be210f | Juan Quintela | echo "TARGET_GPROF=yes" >> $config_target_mak |
3548 | d02c1db3 | Juan Quintela | if test "$target_linux_user" = "yes" ; then |
3549 | d02c1db3 | Juan Quintela | cflags="-p $cflags" |
3550 | d02c1db3 | Juan Quintela | ldflags="-p $ldflags" |
3551 | d02c1db3 | Juan Quintela | fi |
3552 | d02c1db3 | Juan Quintela | if test "$target_softmmu" = "yes" ; then |
3553 | d02c1db3 | Juan Quintela | ldflags="-p $ldflags" |
3554 | 25be210f | Juan Quintela | echo "GPROF_CFLAGS=-p" >> $config_target_mak |
3555 | d02c1db3 | Juan Quintela | fi |
3556 | d02c1db3 | Juan Quintela | fi |
3557 | d02c1db3 | Juan Quintela | |
3558 | 6ee7126f | Juan Quintela | linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld" |
3559 | 9b8e111f | Juan Quintela | if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then |
3560 | fa282484 | Juan Quintela | case "$ARCH" in |
3561 | fa282484 | Juan Quintela | sparc) |
3562 | fa282484 | Juan Quintela | # -static is used to avoid g1/g3 usage by the dynamic linker |
3563 | 322e5878 | Juan Quintela | ldflags="$linker_script -static $ldflags" |
3564 | fa282484 | Juan Quintela | ;; |
3565 | 4d58be06 | Richard Henderson | alpha | s390x) |
3566 | 4d58be06 | Richard Henderson | # The default placement of the application is fine. |
3567 | 4d58be06 | Richard Henderson | ;; |
3568 | fd76e73a | Richard Henderson | *) |
3569 | 322e5878 | Juan Quintela | ldflags="$linker_script $ldflags" |
3570 | fa282484 | Juan Quintela | ;; |
3571 | fa282484 | Juan Quintela | esac |
3572 | fa282484 | Juan Quintela | fi |
3573 | fa282484 | Juan Quintela | |
3574 | e205c790 | Jan Kiszka | # use included Linux headers |
3575 | af2be207 | Jan Kiszka | if test "$linux" = "yes" ; then |
3576 | af2be207 | Jan Kiszka | includes="-I\$(SRC_PATH)/linux-headers $includes" |
3577 | af2be207 | Jan Kiszka | mkdir -p linux-headers |
3578 | af2be207 | Jan Kiszka | case "$cpu" in |
3579 | af2be207 | Jan Kiszka | i386|x86_64) |
3580 | af2be207 | Jan Kiszka | symlink $source_path/linux-headers/asm-x86 linux-headers/asm |
3581 | af2be207 | Jan Kiszka | ;; |
3582 | af2be207 | Jan Kiszka | ppcemb|ppc|ppc64) |
3583 | af2be207 | Jan Kiszka | symlink $source_path/linux-headers/asm-powerpc linux-headers/asm |
3584 | af2be207 | Jan Kiszka | ;; |
3585 | af2be207 | Jan Kiszka | s390x) |
3586 | af2be207 | Jan Kiszka | symlink $source_path/linux-headers/asm-s390 linux-headers/asm |
3587 | af2be207 | Jan Kiszka | ;; |
3588 | af2be207 | Jan Kiszka | esac |
3589 | af2be207 | Jan Kiszka | fi |
3590 | e205c790 | Jan Kiszka | |
3591 | 25be210f | Juan Quintela | echo "LDFLAGS+=$ldflags" >> $config_target_mak |
3592 | 25be210f | Juan Quintela | echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak |
3593 | f9728943 | Paolo Bonzini | echo "QEMU_INCLUDES+=$includes" >> $config_target_mak |
3594 | fa282484 | Juan Quintela | |
3595 | 97a847bc | bellard | done # for target in $targets |
3596 | 7d13299d | bellard | |
3597 | d1807a4f | Paolo Bonzini | # build tree in object directory in case the source is not in the current directory |
3598 | d1807a4f | Paolo Bonzini | DIRS="tests tests/cris slirp audio block net pc-bios/optionrom" |
3599 | 446b9165 | Andreas Färber | DIRS="$DIRS pc-bios/spapr-rtas" |
3600 | d1807a4f | Paolo Bonzini | DIRS="$DIRS roms/seabios roms/vgabios" |
3601 | d1807a4f | Paolo Bonzini | DIRS="$DIRS fsdev ui" |
3602 | 2345c77c | Michael Roth | DIRS="$DIRS qapi" |
3603 | 13a286d5 | Michael Roth | DIRS="$DIRS qga" |
3604 | d1807a4f | Paolo Bonzini | FILES="Makefile tests/Makefile" |
3605 | d1807a4f | Paolo Bonzini | FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" |
3606 | d1807a4f | Paolo Bonzini | FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" |
3607 | 446b9165 | Andreas Färber | FILES="$FILES pc-bios/spapr-rtas/Makefile" |
3608 | d1807a4f | Paolo Bonzini | FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" |
3609 | 5ee8ad71 | Alex Williamson | for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.rom $source_path/pc-bios/*.dtb $source_path/pc-bios/openbios-*; do |
3610 | d1807a4f | Paolo Bonzini | FILES="$FILES pc-bios/`basename $bios_file`" |
3611 | d1807a4f | Paolo Bonzini | done |
3612 | d1807a4f | Paolo Bonzini | mkdir -p $DIRS |
3613 | d1807a4f | Paolo Bonzini | for f in $FILES ; do |
3614 | f9245e10 | Peter Maydell | if [ -e "$source_path/$f" ] && ! [ -e "$f" ]; then |
3615 | f9245e10 | Peter Maydell | symlink "$source_path/$f" "$f" |
3616 | f9245e10 | Peter Maydell | fi |
3617 | d1807a4f | Paolo Bonzini | done |
3618 | 1ad2134f | Paul Brook | |
3619 | c34ebfdc | Anthony Liguori | # temporary config to build submodules |
3620 | 2d9f27d2 | Anthony Liguori | for rom in seabios vgabios ; do |
3621 | c34ebfdc | Anthony Liguori | config_mak=roms/$rom/config.mak |
3622 | 37116c89 | Stefan Weil | echo "# Automatically generated by configure - do not modify" > $config_mak |
3623 | c34ebfdc | Anthony Liguori | echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak |
3624 | c34ebfdc | Anthony Liguori | echo "CC=$cc" >> $config_mak |
3625 | c34ebfdc | Anthony Liguori | echo "BCC=bcc" >> $config_mak |
3626 | c34ebfdc | Anthony Liguori | echo "CPP=${cross_prefix}cpp" >> $config_mak |
3627 | c34ebfdc | Anthony Liguori | echo "OBJCOPY=objcopy" >> $config_mak |
3628 | c34ebfdc | Anthony Liguori | echo "IASL=iasl" >> $config_mak |
3629 | c34ebfdc | Anthony Liguori | echo "LD=$ld" >> $config_mak |
3630 | c34ebfdc | Anthony Liguori | done |
3631 | c34ebfdc | Anthony Liguori | |
3632 | 1ad2134f | Paul Brook | for hwlib in 32 64; do |
3633 | 1ad2134f | Paul Brook | d=libhw$hwlib |
3634 | 1ad2134f | Paul Brook | mkdir -p $d |
3635 | 9953b2fc | Blue Swirl | mkdir -p $d/ide |
3636 | 11568d6d | Paolo Bonzini | symlink $source_path/Makefile.hw $d/Makefile |
3637 | 353ac78d | Aneesh Kumar K.V | mkdir -p $d/9pfs |
3638 | 37116c89 | Stefan Weil | echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak |
3639 | 1ad2134f | Paul Brook | done |
3640 | add16157 | Blue Swirl | |
3641 | 111a38b0 | Robert Relyea | if [ "$source_path" != `pwd` ]; then |
3642 | 111a38b0 | Robert Relyea | # out of tree build |
3643 | 111a38b0 | Robert Relyea | mkdir -p libcacard |
3644 | 111a38b0 | Robert Relyea | rm -f libcacard/Makefile |
3645 | 44dc0ca3 | Alon Levy | symlink "$source_path/libcacard/Makefile" libcacard/Makefile |
3646 | 111a38b0 | Robert Relyea | fi |
3647 | 111a38b0 | Robert Relyea | |
3648 | add16157 | Blue Swirl | d=libuser |
3649 | add16157 | Blue Swirl | mkdir -p $d |
3650 | 11568d6d | Paolo Bonzini | symlink $source_path/Makefile.user $d/Makefile |
3651 | 299060a0 | Kirill A. Shutemov | if test "$static" = "no" -a "$user_pie" = "yes" ; then |
3652 | 299060a0 | Kirill A. Shutemov | echo "QEMU_CFLAGS+=-fpie" > $d/config.mak |
3653 | 299060a0 | Kirill A. Shutemov | fi |
3654 | b40292e7 | Jan Kiszka | |
3655 | b40292e7 | Jan Kiszka | if test "$docs" = "yes" ; then |
3656 | b40292e7 | Jan Kiszka | mkdir -p QMP |
3657 | b40292e7 | Jan Kiszka | fi |