Commit | Line | Data |
---|---|---|
67bf9823 JA |
1 | #!/bin/sh |
2 | # | |
3 | # Fio configure script. Heavily influenced by the manual qemu configure | |
c922e0b0 | 4 | # script. Sad this is easier than autoconf and enemies. |
67bf9823 JA |
5 | # |
6 | ||
7 | # set temporary file name | |
8 | if test ! -z "$TMPDIR" ; then | |
9 | TMPDIR1="${TMPDIR}" | |
10 | elif test ! -z "$TEMPDIR" ; then | |
11 | TMPDIR1="${TEMPDIR}" | |
12 | else | |
13 | TMPDIR1="/tmp" | |
14 | fi | |
15 | ||
16 | TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c" | |
9ee669fa | 17 | TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c" |
67bf9823 JA |
18 | TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o" |
19 | TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe" | |
20 | ||
21 | # NB: do not call "exit" in the trap handler; this is buggy with some shells; | |
22 | # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org> | |
9ee669fa | 23 | trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM |
67bf9823 JA |
24 | |
25 | rm -rf config.log | |
26 | ||
27 | config_host_mak="config-host.mak" | |
4feafb1e JA |
28 | config_host_h="config-host.h" |
29 | ||
30 | rm -rf $config_host_mak | |
31 | rm -rf $config_host_h | |
67bf9823 | 32 | |
d7145a78 JA |
33 | fatal() { |
34 | echo $@ | |
35 | echo "Configure failed, check config.log and/or the above output" | |
36 | rm -rf $config_host_mak | |
37 | rm -rf $config_host_h | |
38 | exit 1 | |
39 | } | |
40 | ||
484b0b65 TK |
41 | # Print result for each configuration test |
42 | print_config() { | |
43 | printf "%-30s%s\n" "$1" "$2" | |
44 | } | |
45 | ||
44404c5a | 46 | # Default CFLAGS |
af4862b3 JA |
47 | CFLAGS="-D_GNU_SOURCE -include config-host.h" |
48 | BUILD_CFLAGS="" | |
67bf9823 JA |
49 | |
50 | # Print a helpful header at the top of config.log | |
51 | echo "# FIO configure log $(date)" >> config.log | |
52 | printf "# Configured with:" >> config.log | |
53 | printf " '%s'" "$0" "$@" >> config.log | |
54 | echo >> config.log | |
55 | echo "#" >> config.log | |
56 | ||
7560fe7c JA |
57 | # Print configure header at the top of $config_host_h |
58 | echo "/*" > $config_host_h | |
59 | echo " * Automatically generated by configure - do not modify" >> $config_host_h | |
60 | printf " * Configured with:" >> $config_host_h | |
61 | printf " * '%s'" "$0" "$@" >> $config_host_h | |
62 | echo "" >> $config_host_h | |
63 | echo " */" >> $config_host_h | |
64 | ||
67bf9823 JA |
65 | do_cc() { |
66 | # Run the compiler, capturing its output to the log. | |
67 | echo $cc "$@" >> config.log | |
68 | $cc "$@" >> config.log 2>&1 || return $? | |
69 | # Test passed. If this is an --enable-werror build, rerun | |
70 | # the test with -Werror and bail out if it fails. This | |
71 | # makes warning-generating-errors in configure test code | |
72 | # obvious to developers. | |
73 | if test "$werror" != "yes"; then | |
74 | return 0 | |
75 | fi | |
76 | # Don't bother rerunning the compile if we were already using -Werror | |
77 | case "$*" in | |
78 | *-Werror*) | |
79 | return 0 | |
80 | ;; | |
81 | esac | |
82 | echo $cc -Werror "$@" >> config.log | |
83 | $cc -Werror "$@" >> config.log 2>&1 && return $? | |
84 | echo "ERROR: configure test passed without -Werror but failed with -Werror." | |
85 | echo "This is probably a bug in the configure script. The failing command" | |
86 | echo "will be at the bottom of config.log." | |
d7145a78 | 87 | fatal "You can run configure with --disable-werror to bypass this check." |
67bf9823 JA |
88 | } |
89 | ||
90 | compile_object() { | |
91 | do_cc $CFLAGS -c -o $TMPO $TMPC | |
92 | } | |
93 | ||
94 | compile_prog() { | |
95 | local_cflags="$1" | |
adaa46d8 | 96 | local_ldflags="$2 $LIBS" |
67bf9823 JA |
97 | echo "Compiling test case $3" >> config.log |
98 | do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags | |
99 | } | |
100 | ||
101 | feature_not_found() { | |
102 | feature=$1 | |
c55d728b | 103 | packages=$2 |
67bf9823 JA |
104 | |
105 | echo "ERROR" | |
106 | echo "ERROR: User requested feature $feature" | |
c55d728b JA |
107 | if test ! -z "$packages" ; then |
108 | echo "ERROR: That feature needs $packages installed" | |
109 | fi | |
67bf9823 | 110 | echo "ERROR: configure was not able to find it" |
d7145a78 | 111 | fatal "ERROR" |
67bf9823 JA |
112 | } |
113 | ||
114 | has() { | |
115 | type "$1" >/dev/null 2>&1 | |
116 | } | |
117 | ||
118 | check_define() { | |
119 | cat > $TMPC <<EOF | |
120 | #if !defined($1) | |
121 | #error $1 not defined | |
122 | #endif | |
123 | int main(void) | |
124 | { | |
125 | return 0; | |
126 | } | |
127 | EOF | |
128 | compile_object | |
129 | } | |
130 | ||
4feafb1e JA |
131 | output_sym() { |
132 | echo "$1=y" >> $config_host_mak | |
133 | echo "#define $1" >> $config_host_h | |
134 | } | |
135 | ||
67bf9823 JA |
136 | targetos="" |
137 | cpu="" | |
138 | ||
91f94d5b | 139 | # default options |
47f44635 JA |
140 | show_help="no" |
141 | exit_val=0 | |
ebec2094 | 142 | gfio_check="no" |
1b10477b | 143 | libhdfs="no" |
43f3cec2 | 144 | pmemblk="no" |
cbb15e42 | 145 | devdax="no" |
ae0db592 | 146 | pmem="no" |
de26b824 | 147 | disable_lex="" |
3ee2a3c1 | 148 | disable_pmem="no" |
a817dc3b | 149 | disable_native="no" |
9f75af77 | 150 | march_set="no" |
247ef2aa | 151 | libiscsi="no" |
020d54bd | 152 | prefix=/usr/local |
91f94d5b | 153 | |
cb1125b0 JA |
154 | # parse options |
155 | for opt do | |
156 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` | |
157 | case "$opt" in | |
020d54bd JA |
158 | --prefix=*) prefix="$optarg" |
159 | ;; | |
8b156d8e JA |
160 | --cpu=*) cpu="$optarg" |
161 | ;; | |
c8931876 JA |
162 | # esx is cross compiled and cannot be detect through simple uname calls |
163 | --esx) | |
164 | esx="yes" | |
165 | ;; | |
cb1125b0 JA |
166 | --cc=*) CC="$optarg" |
167 | ;; | |
208e4c8b JA |
168 | --extra-cflags=*) CFLAGS="$CFLAGS $optarg" |
169 | ;; | |
b7c12794 | 170 | --build-32bit-win) build_32bit_win="yes" |
7409711b | 171 | ;; |
a6ab5391 SW |
172 | --target-win-ver=*) target_win_ver="$optarg" |
173 | ;; | |
d2aeedb9 JA |
174 | --build-static) build_static="yes" |
175 | ;; | |
bad7e42c | 176 | --enable-gfio) gfio_check="yes" |
899fab33 | 177 | ;; |
44462517 CF |
178 | --disable-numa) disable_numa="yes" |
179 | ;; | |
f678f8d2 MF |
180 | --disable-rdma) disable_rdma="yes" |
181 | ;; | |
d5f9b0ea IF |
182 | --disable-rados) disable_rados="yes" |
183 | ;; | |
ce18290e TM |
184 | --disable-rbd) disable_rbd="yes" |
185 | ;; | |
c2f6a13d LMB |
186 | --disable-http) disable_http="yes" |
187 | ;; | |
ce18290e TM |
188 | --disable-gfapi) disable_gfapi="yes" |
189 | ;; | |
1b10477b MM |
190 | --enable-libhdfs) libhdfs="yes" |
191 | ;; | |
a655bbc4 JA |
192 | --disable-lex) disable_lex="yes" |
193 | ;; | |
de26b824 JA |
194 | --enable-lex) disable_lex="no" |
195 | ;; | |
61054f0d JA |
196 | --disable-shm) no_shm="yes" |
197 | ;; | |
198 | --disable-optimizations) disable_opt="yes" | |
ba40757e | 199 | ;; |
3ee2a3c1 DJ |
200 | --disable-pmem) disable_pmem="yes" |
201 | ;; | |
03553853 YR |
202 | --enable-cuda) enable_cuda="yes" |
203 | ;; | |
a817dc3b JA |
204 | --disable-native) disable_native="yes" |
205 | ;; | |
a40e7a59 GB |
206 | --with-ime=*) ime_path="$optarg" |
207 | ;; | |
247ef2aa KZ |
208 | --enable-libiscsi) libiscsi="yes" |
209 | ;; | |
01fe773d JD |
210 | --disable-tcmalloc) disable_tcmalloc="yes" |
211 | ;; | |
827da4f5 | 212 | --help) |
47f44635 | 213 | show_help="yes" |
827da4f5 | 214 | ;; |
cb1125b0 JA |
215 | *) |
216 | echo "Bad option $opt" | |
47f44635 JA |
217 | show_help="yes" |
218 | exit_val=1 | |
cb1125b0 JA |
219 | esac |
220 | done | |
221 | ||
47f44635 | 222 | if test "$show_help" = "yes" ; then |
05cef7a0 TK |
223 | echo "--prefix= Use this directory as installation prefix" |
224 | echo "--cpu= Specify target CPU if auto-detect fails" | |
225 | echo "--cc= Specify compiler to use" | |
226 | echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" | |
227 | echo "--build-32bit-win Enable 32-bit build on Windows" | |
a6ab5391 | 228 | echo "--target-win-ver= Minimum version of Windows to target (XP or 7)" |
05cef7a0 TK |
229 | echo "--build-static Build a static fio" |
230 | echo "--esx Configure build options for esx" | |
231 | echo "--enable-gfio Enable building of gtk gfio" | |
232 | echo "--disable-numa Disable libnuma even if found" | |
03553853 | 233 | echo "--disable-rdma Disable RDMA support even if found" |
e75a6fac JH |
234 | echo "--disable-rados Disable Rados support even if found" |
235 | echo "--disable-rbd Disable Rados Block Device even if found" | |
236 | echo "--disable-http Disable HTTP support even if found" | |
05cef7a0 TK |
237 | echo "--disable-gfapi Disable gfapi" |
238 | echo "--enable-libhdfs Enable hdfs support" | |
239 | echo "--disable-lex Disable use of lex/yacc for math" | |
240 | echo "--disable-pmem Disable pmem based engines even if found" | |
241 | echo "--enable-lex Enable use of lex/yacc for math" | |
242 | echo "--disable-shm Disable SHM support" | |
61054f0d | 243 | echo "--disable-optimizations Don't enable compiler optimizations" |
03553853 | 244 | echo "--enable-cuda Enable GPUDirect RDMA support" |
a817dc3b | 245 | echo "--disable-native Don't build for native host" |
a40e7a59 | 246 | echo "--with-ime= Install path for DDN's Infinite Memory Engine" |
247ef2aa | 247 | echo "--enable-libiscsi Enable iscsi support" |
01fe773d | 248 | echo "--disable-tcmalloc Disable tcmalloc support" |
b7a99316 | 249 | exit $exit_val |
47f44635 JA |
250 | fi |
251 | ||
47986339 | 252 | cross_prefix=${cross_prefix-${CROSS_COMPILE}} |
b73af738 SW |
253 | # Preferred compiler (can be overriden later after we know the platform): |
254 | # ${CC} (if set) | |
255 | # ${cross_prefix}gcc (if cross-prefix specified) | |
256 | # gcc if available | |
257 | # clang if available | |
258 | if test -z "${CC}${cross_prefix}"; then | |
259 | if has gcc; then | |
260 | cc=gcc | |
261 | elif has clang; then | |
262 | cc=clang | |
263 | fi | |
264 | else | |
265 | cc="${CC-${cross_prefix}gcc}" | |
266 | fi | |
47986339 | 267 | |
6d0e9f83 AC |
268 | if check_define __ANDROID__ ; then |
269 | targetos="Android" | |
270 | elif check_define __linux__ ; then | |
67bf9823 | 271 | targetos="Linux" |
67bf9823 JA |
272 | elif check_define __OpenBSD__ ; then |
273 | targetos='OpenBSD' | |
89556808 BVA |
274 | elif check_define __NetBSD__ ; then |
275 | targetos='NetBSD' | |
67bf9823 JA |
276 | elif check_define __sun__ ; then |
277 | targetos='SunOS' | |
7cb024f8 | 278 | CFLAGS="$CFLAGS -D_REENTRANT" |
b24f59ab SH |
279 | elif check_define _WIN32 ; then |
280 | targetos='CYGWIN' | |
67bf9823 JA |
281 | else |
282 | targetos=`uname -s` | |
283 | fi | |
284 | ||
53cd4eee AC |
285 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
286 | printf "# Configured with:" >> $config_host_mak | |
287 | printf " '%s'" "$0" "$@" >> $config_host_mak | |
288 | echo >> $config_host_mak | |
289 | echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak | |
290 | ||
61054f0d JA |
291 | if test "$no_shm" = "yes" ; then |
292 | output_sym "CONFIG_NO_SHM" | |
293 | fi | |
294 | ||
295 | if test "$disable_opt" = "yes" ; then | |
296 | output_sym "CONFIG_FIO_NO_OPT" | |
297 | fi | |
298 | ||
67bf9823 JA |
299 | # Some host OSes need non-standard checks for which CPU to use. |
300 | # Note that these checks are broken for cross-compilation: if you're | |
301 | # cross-compiling to one of these OSes then you'll need to specify | |
302 | # the correct CPU with the --cpu option. | |
303 | case $targetos in | |
26532556 | 304 | AIX|OpenBSD|NetBSD) |
de26b824 | 305 | # Unless explicitly enabled, turn off lex. |
baa78fdc | 306 | # OpenBSD will hit syntax error when enabled. |
de26b824 JA |
307 | if test -z "$disable_lex" ; then |
308 | disable_lex="yes" | |
daf705b5 JA |
309 | else |
310 | force_no_lex_o="yes" | |
de26b824 JA |
311 | fi |
312 | ;; | |
f22dd97a RC |
313 | FreeBSD) |
314 | CFLAGS="$CFLAGS -I/usr/local/include" | |
315 | LDFLAGS="$LDFLAGS -L/usr/local/lib" | |
316 | ;; | |
67bf9823 JA |
317 | Darwin) |
318 | # on Leopard most of the system is 32-bit, so we have to ask the kernel if | |
319 | # we can run 64-bit userspace code. | |
320 | # If the user didn't specify a CPU explicitly and the kernel says this is | |
321 | # 64 bit hw, then assume x86_64. Otherwise fall through to the usual | |
322 | # detection code. | |
323 | if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then | |
324 | cpu="x86_64" | |
325 | fi | |
ccf2d89d SW |
326 | # Error at compile time linking of weak/partial symbols if possible... |
327 | cat > $TMPC <<EOF | |
328 | int main(void) | |
329 | { | |
330 | return 0; | |
331 | } | |
332 | EOF | |
333 | if compile_prog "" "-Wl,-no_weak_imports" "disable weak symbols"; then | |
334 | echo "Disabling weak symbols" | |
335 | LDFLAGS="$LDFLAGS -Wl,-no_weak_imports" | |
336 | fi | |
67bf9823 JA |
337 | ;; |
338 | SunOS) | |
339 | # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo | |
340 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then | |
341 | cpu="x86_64" | |
342 | fi | |
adaa46d8 | 343 | LIBS="-lnsl -lsocket" |
cfd94f79 JA |
344 | ;; |
345 | CYGWIN*) | |
ca205a75 TK |
346 | # We still force some options, so keep this message here. |
347 | echo "Forcing some known good options on Windows" | |
b73af738 | 348 | if test -z "${CC}${cross_prefix}"; then |
7409711b | 349 | if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then |
b73af738 | 350 | cc="i686-w64-mingw32-gcc" |
7409711b | 351 | else |
b73af738 | 352 | cc="x86_64-w64-mingw32-gcc" |
7409711b | 353 | fi |
4578d01f | 354 | fi |
a6ab5391 SW |
355 | |
356 | target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]') | |
357 | if test -z "$target_win_ver"; then | |
358 | # Default Windows API target | |
359 | target_win_ver="7" | |
360 | fi | |
361 | if test "$target_win_ver" = "XP"; then | |
362 | output_sym "CONFIG_WINDOWS_XP" | |
363 | elif test "$target_win_ver" = "7"; then | |
364 | output_sym "CONFIG_WINDOWS_7" | |
365 | CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601" | |
7409711b | 366 | else |
a6ab5391 | 367 | fatal "Unknown target Windows version" |
7409711b | 368 | fi |
a6ab5391 | 369 | |
ca205a75 TK |
370 | # We need this to be output_sym'd here because this is Windows specific. |
371 | # The regular configure path never sets this config. | |
4feafb1e | 372 | output_sym "CONFIG_WINDOWSAIO" |
ca205a75 TK |
373 | # We now take the regular configuration path without having exit 0 here. |
374 | # Flags below are still necessary mostly for MinGW. | |
12ed4fc8 | 375 | build_static="yes" |
ca205a75 | 376 | socklen_t="yes" |
ca205a75 TK |
377 | rusage_thread="yes" |
378 | fdatasync="yes" | |
379 | clock_gettime="yes" # clock_monotonic probe has dependency on this | |
380 | clock_monotonic="yes" | |
381 | gettimeofday="yes" | |
382 | sched_idle="yes" | |
383 | tcp_nodelay="yes" | |
ca205a75 | 384 | ipv6="yes" |
6d0e9f83 | 385 | ;; |
67bf9823 JA |
386 | esac |
387 | ||
b73af738 SW |
388 | # Now we know the target platform we can have another guess at the preferred |
389 | # compiler when it wasn't explictly set | |
390 | if test -z "${CC}${cross_prefix}"; then | |
391 | if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then | |
392 | if has clang; then | |
393 | cc=clang | |
394 | fi | |
395 | fi | |
396 | fi | |
397 | if test -z "$cc"; then | |
398 | echo "configure: failed to find compiler" | |
399 | exit 1 | |
400 | fi | |
401 | ||
67bf9823 JA |
402 | if test ! -z "$cpu" ; then |
403 | # command line argument | |
404 | : | |
405 | elif check_define __i386__ ; then | |
406 | cpu="i386" | |
407 | elif check_define __x86_64__ ; then | |
408 | cpu="x86_64" | |
409 | elif check_define __sparc__ ; then | |
410 | if check_define __arch64__ ; then | |
411 | cpu="sparc64" | |
412 | else | |
413 | cpu="sparc" | |
414 | fi | |
415 | elif check_define _ARCH_PPC ; then | |
416 | if check_define _ARCH_PPC64 ; then | |
417 | cpu="ppc64" | |
418 | else | |
419 | cpu="ppc" | |
420 | fi | |
421 | elif check_define __mips__ ; then | |
422 | cpu="mips" | |
423 | elif check_define __ia64__ ; then | |
424 | cpu="ia64" | |
425 | elif check_define __s390__ ; then | |
426 | if check_define __s390x__ ; then | |
427 | cpu="s390x" | |
428 | else | |
429 | cpu="s390" | |
430 | fi | |
431 | elif check_define __arm__ ; then | |
432 | cpu="arm" | |
214e2d56 | 433 | elif check_define __aarch64__ ; then |
434 | cpu="aarch64" | |
67bf9823 JA |
435 | elif check_define __hppa__ ; then |
436 | cpu="hppa" | |
437 | else | |
438 | cpu=`uname -m` | |
439 | fi | |
440 | ||
441 | # Normalise host CPU name and set ARCH. | |
442 | case "$cpu" in | |
443 | ia64|ppc|ppc64|s390|s390x|sparc64) | |
444 | cpu="$cpu" | |
445 | ;; | |
446 | i386|i486|i586|i686|i86pc|BePC) | |
95ef38ab | 447 | cpu="x86" |
67bf9823 JA |
448 | ;; |
449 | x86_64|amd64) | |
450 | cpu="x86_64" | |
451 | ;; | |
452 | armv*b|armv*l|arm) | |
453 | cpu="arm" | |
454 | ;; | |
214e2d56 | 455 | aarch64) |
456 | cpu="arm64" | |
457 | ;; | |
67bf9823 JA |
458 | hppa|parisc|parisc64) |
459 | cpu="hppa" | |
460 | ;; | |
461 | mips*) | |
462 | cpu="mips" | |
463 | ;; | |
464 | sparc|sun4[cdmuv]) | |
465 | cpu="sparc" | |
466 | ;; | |
467 | *) | |
8b156d8e | 468 | echo "Unknown CPU" |
67bf9823 JA |
469 | ;; |
470 | esac | |
471 | ||
1a17cfdb AC |
472 | ########################################## |
473 | # check cross compile | |
474 | ||
ca205a75 TK |
475 | if test "$cross_compile" != "yes" ; then |
476 | cross_compile="no" | |
477 | fi | |
1a17cfdb AC |
478 | cat > $TMPC <<EOF |
479 | int main(void) | |
480 | { | |
481 | return 0; | |
482 | } | |
483 | EOF | |
484 | if compile_prog "" "" "cross"; then | |
485 | $TMPE 2>/dev/null || cross_compile="yes" | |
486 | else | |
487 | fatal "compile test failed" | |
488 | fi | |
489 | ||
0dcebdf4 JA |
490 | ########################################## |
491 | # check endianness | |
ca205a75 TK |
492 | if test "$bigendian" != "yes" ; then |
493 | bigendian="no" | |
494 | fi | |
1a17cfdb AC |
495 | if test "$cross_compile" = "no" ; then |
496 | cat > $TMPC <<EOF | |
0dcebdf4 JA |
497 | #include <inttypes.h> |
498 | int main(void) | |
499 | { | |
500 | volatile uint32_t i=0x01234567; | |
501 | return (*((uint8_t*)(&i))) == 0x67; | |
502 | } | |
503 | EOF | |
1a17cfdb AC |
504 | if compile_prog "" "" "endian"; then |
505 | $TMPE && bigendian="yes" | |
506 | fi | |
507 | else | |
508 | # If we're cross compiling, try our best to work it out and rely on the | |
509 | # run-time check to fail if we get it wrong. | |
510 | cat > $TMPC <<EOF | |
511 | #include <endian.h> | |
512 | int main(void) | |
513 | { | |
514 | #if __BYTE_ORDER != __BIG_ENDIAN | |
515 | # error "Unknown endianness" | |
516 | #endif | |
517 | } | |
518 | EOF | |
519 | compile_prog "" "" "endian" && bigendian="yes" | |
520 | check_define "__ARMEB__" && bigendian="yes" | |
521 | check_define "__MIPSEB__" && bigendian="yes" | |
0dcebdf4 JA |
522 | fi |
523 | ||
524 | ||
484b0b65 TK |
525 | print_config "Operating system" "$targetos" |
526 | print_config "CPU" "$cpu" | |
527 | print_config "Big endian" "$bigendian" | |
a6ab5391 SW |
528 | if test ! -z "$target_win_ver"; then |
529 | print_config "Target Windows version" "$target_win_ver" | |
530 | fi | |
484b0b65 TK |
531 | print_config "Compiler" "$cc" |
532 | print_config "Cross compile" "$cross_compile" | |
67bf9823 JA |
533 | echo |
534 | ||
d2aeedb9 JA |
535 | ########################################## |
536 | # See if we need to build a static build | |
537 | if test "$build_static" = "yes" ; then | |
538 | CFLAGS="$CFLAGS -ffunction-sections -fdata-sections" | |
539 | LDFLAGS="$LDFLAGS -static -Wl,--gc-sections" | |
540 | else | |
541 | build_static="no" | |
542 | fi | |
484b0b65 | 543 | print_config "Static build" "$build_static" |
d2aeedb9 | 544 | |
67bf9823 JA |
545 | ########################################## |
546 | # check for wordsize | |
547 | wordsize="0" | |
548 | cat > $TMPC <<EOF | |
142429e5 AC |
549 | #include <limits.h> |
550 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | |
67bf9823 JA |
551 | int main(void) |
552 | { | |
142429e5 | 553 | BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE); |
67bf9823 JA |
554 | return 0; |
555 | } | |
556 | EOF | |
142429e5 AC |
557 | if compile_prog "-DWORDSIZE=32" "" "wordsize"; then |
558 | wordsize="32" | |
559 | elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then | |
560 | wordsize="64" | |
561 | else | |
562 | fatal "Unknown wordsize" | |
67bf9823 | 563 | fi |
484b0b65 | 564 | print_config "Wordsize" "$wordsize" |
67bf9823 | 565 | |
a9bca4aa JA |
566 | ########################################## |
567 | # zlib probe | |
ca205a75 TK |
568 | if test "$zlib" != "yes" ; then |
569 | zlib="no" | |
570 | fi | |
a9bca4aa | 571 | cat > $TMPC <<EOF |
804a1e05 | 572 | #include <zlib.h> |
a9bca4aa JA |
573 | int main(void) |
574 | { | |
575 | z_stream stream; | |
576 | if (inflateInit(&stream) != Z_OK) | |
577 | return 1; | |
578 | return 0; | |
579 | } | |
580 | EOF | |
581 | if compile_prog "" "-lz" "zlib" ; then | |
582 | zlib=yes | |
583 | LIBS="-lz $LIBS" | |
a9bca4aa | 584 | fi |
484b0b65 | 585 | print_config "zlib" "$zlib" |
a9bca4aa | 586 | |
67bf9823 JA |
587 | ########################################## |
588 | # linux-aio probe | |
ca205a75 TK |
589 | if test "$libaio" != "yes" ; then |
590 | libaio="no" | |
591 | fi | |
7c77ebef | 592 | if test "$esx" != "yes" ; then |
593 | cat > $TMPC <<EOF | |
67bf9823 JA |
594 | #include <libaio.h> |
595 | #include <stddef.h> | |
596 | int main(void) | |
597 | { | |
598 | io_setup(0, NULL); | |
599 | return 0; | |
600 | } | |
601 | EOF | |
7c77ebef | 602 | if compile_prog "" "-laio" "libaio" ; then |
603 | libaio=yes | |
604 | LIBS="-laio $LIBS" | |
605 | else | |
606 | if test "$libaio" = "yes" ; then | |
607 | feature_not_found "linux AIO" "libaio-dev or libaio-devel" | |
608 | fi | |
609 | libaio=no | |
67bf9823 | 610 | fi |
67bf9823 | 611 | fi |
484b0b65 | 612 | print_config "Linux AIO support" "$libaio" |
67bf9823 JA |
613 | |
614 | ########################################## | |
615 | # posix aio probe | |
ca205a75 TK |
616 | if test "$posix_aio" != "yes" ; then |
617 | posix_aio="no" | |
618 | fi | |
619 | if test "$posix_aio_lrt" != "yes" ; then | |
620 | posix_aio_lrt="no" | |
621 | fi | |
67bf9823 JA |
622 | cat > $TMPC <<EOF |
623 | #include <aio.h> | |
624 | int main(void) | |
625 | { | |
626 | struct aiocb cb; | |
627 | aio_read(&cb); | |
628 | return 0; | |
629 | } | |
630 | EOF | |
631 | if compile_prog "" "" "posixaio" ; then | |
632 | posix_aio="yes" | |
09c81e13 | 633 | elif compile_prog "" "-lrt" "posixaio -lrt"; then |
67bf9823 JA |
634 | posix_aio="yes" |
635 | posix_aio_lrt="yes" | |
636 | LIBS="-lrt $LIBS" | |
637 | fi | |
484b0b65 TK |
638 | print_config "POSIX AIO support" "$posix_aio" |
639 | print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt" | |
67bf9823 JA |
640 | |
641 | ########################################## | |
642 | # posix aio fsync probe | |
ca205a75 TK |
643 | if test "$posix_aio_fsync" != "yes" ; then |
644 | posix_aio_fsync="no" | |
645 | fi | |
67bf9823 JA |
646 | if test "$posix_aio" = "yes" ; then |
647 | cat > $TMPC <<EOF | |
648 | #include <fcntl.h> | |
649 | #include <aio.h> | |
650 | int main(void) | |
651 | { | |
652 | struct aiocb cb; | |
653 | return aio_fsync(O_SYNC, &cb); | |
654 | return 0; | |
655 | } | |
656 | EOF | |
657 | if compile_prog "" "$LIBS" "posix_aio_fsync" ; then | |
658 | posix_aio_fsync=yes | |
659 | fi | |
660 | fi | |
484b0b65 | 661 | print_config "POSIX AIO fsync" "$posix_aio_fsync" |
67bf9823 | 662 | |
06eac6b2 SW |
663 | ########################################## |
664 | # POSIX pshared attribute probe | |
d418fa90 TK |
665 | if test "$posix_pshared" != "yes" ; then |
666 | posix_pshared="no" | |
667 | fi | |
06eac6b2 SW |
668 | cat > $TMPC <<EOF |
669 | #include <unistd.h> | |
670 | int main(void) | |
671 | { | |
672 | #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0) | |
673 | # if defined(__CYGWIN__) | |
674 | # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin" | |
675 | # elif defined(__APPLE__) | |
676 | # include <AvailabilityMacros.h> | |
677 | # include <TargetConditionals.h> | |
678 | # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070 | |
679 | # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7" | |
680 | # endif | |
681 | # endif | |
682 | #else | |
683 | # error "_POSIX_THREAD_PROCESS_SHARED is unsupported" | |
684 | #endif | |
685 | return 0; | |
686 | } | |
687 | EOF | |
688 | if compile_prog "" "$LIBS" "posix_pshared" ; then | |
689 | posix_pshared=yes | |
690 | fi | |
484b0b65 | 691 | print_config "POSIX pshared support" "$posix_pshared" |
06eac6b2 | 692 | |
67bf9823 JA |
693 | ########################################## |
694 | # solaris aio probe | |
ca205a75 TK |
695 | if test "$solaris_aio" != "yes" ; then |
696 | solaris_aio="no" | |
697 | fi | |
67bf9823 JA |
698 | cat > $TMPC <<EOF |
699 | #include <sys/types.h> | |
700 | #include <sys/asynch.h> | |
701 | #include <unistd.h> | |
702 | int main(void) | |
703 | { | |
704 | aio_result_t res; | |
705 | return aioread(0, NULL, 0, 0, SEEK_SET, &res); | |
706 | return 0; | |
707 | } | |
708 | EOF | |
709 | if compile_prog "" "-laio" "solarisaio" ; then | |
710 | solaris_aio=yes | |
711 | LIBS="-laio $LIBS" | |
712 | fi | |
484b0b65 | 713 | print_config "Solaris AIO support" "$solaris_aio" |
67bf9823 JA |
714 | |
715 | ########################################## | |
f5cd2907 | 716 | # __sync_fetch_and_add test |
ca205a75 TK |
717 | if test "$sfaa" != "yes" ; then |
718 | sfaa="no" | |
719 | fi | |
67bf9823 | 720 | cat > $TMPC << EOF |
958886d8 JA |
721 | #include <inttypes.h> |
722 | static int sfaa(uint64_t *ptr) | |
67bf9823 | 723 | { |
9c639a76 | 724 | return __sync_fetch_and_add(ptr, 0); |
67bf9823 JA |
725 | } |
726 | ||
727 | int main(int argc, char **argv) | |
728 | { | |
958886d8 | 729 | uint64_t val = 42; |
67bf9823 JA |
730 | sfaa(&val); |
731 | return val; | |
732 | } | |
733 | EOF | |
734 | if compile_prog "" "" "__sync_fetch_and_add()" ; then | |
735 | sfaa="yes" | |
736 | fi | |
484b0b65 | 737 | print_config "__sync_fetch_and_add" "$sfaa" |
67bf9823 | 738 | |
a250edd0 JA |
739 | ########################################## |
740 | # __sync_synchronize() test | |
741 | if test "$sync_sync" != "yes" ; then | |
742 | sync_sync="no" | |
743 | fi | |
744 | cat > $TMPC << EOF | |
745 | #include <inttypes.h> | |
746 | ||
747 | int main(int argc, char **argv) | |
748 | { | |
749 | __sync_synchronize(); | |
750 | return 0; | |
751 | } | |
752 | EOF | |
753 | if compile_prog "" "" "__sync_synchronize()" ; then | |
754 | sync_sync="yes" | |
755 | fi | |
756 | print_config "__sync_synchronize" "$sync_sync" | |
757 | ||
758 | ########################################## | |
759 | # __sync_val_compare_and_swap() test | |
760 | if test "$cmp_swap" != "yes" ; then | |
761 | cmp_swap="no" | |
762 | fi | |
763 | cat > $TMPC << EOF | |
764 | #include <inttypes.h> | |
765 | ||
766 | int main(int argc, char **argv) | |
767 | { | |
768 | int x = 0; | |
769 | return __sync_val_compare_and_swap(&x, 1, 2); | |
770 | } | |
771 | EOF | |
772 | if compile_prog "" "" "__sync_val_compare_and_swap()" ; then | |
773 | cmp_swap="yes" | |
774 | fi | |
775 | print_config "__sync_val_compare_and_swap" "$cmp_swap" | |
776 | ||
67bf9823 JA |
777 | ########################################## |
778 | # libverbs probe | |
ca205a75 TK |
779 | if test "$libverbs" != "yes" ; then |
780 | libverbs="no" | |
781 | fi | |
67bf9823 | 782 | cat > $TMPC << EOF |
eb3bfdd8 | 783 | #include <infiniband/verbs.h> |
67bf9823 JA |
784 | int main(int argc, char **argv) |
785 | { | |
786 | struct ibv_pd *pd = ibv_alloc_pd(NULL); | |
787 | return 0; | |
788 | } | |
789 | EOF | |
f678f8d2 | 790 | if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then |
67bf9823 JA |
791 | libverbs="yes" |
792 | LIBS="-libverbs $LIBS" | |
793 | fi | |
484b0b65 | 794 | print_config "libverbs" "$libverbs" |
67bf9823 JA |
795 | |
796 | ########################################## | |
797 | # rdmacm probe | |
ca205a75 TK |
798 | if test "$rdmacm" != "yes" ; then |
799 | rdmacm="no" | |
800 | fi | |
67bf9823 JA |
801 | cat > $TMPC << EOF |
802 | #include <stdio.h> | |
803 | #include <rdma/rdma_cma.h> | |
804 | int main(int argc, char **argv) | |
805 | { | |
806 | rdma_destroy_qp(NULL); | |
807 | return 0; | |
808 | } | |
809 | EOF | |
f678f8d2 | 810 | if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then |
67bf9823 JA |
811 | rdmacm="yes" |
812 | LIBS="-lrdmacm $LIBS" | |
813 | fi | |
484b0b65 | 814 | print_config "rdmacm" "$rdmacm" |
67bf9823 | 815 | |
44e8e956 BVA |
816 | ########################################## |
817 | # asprintf() and vasprintf() probes | |
818 | if test "$have_asprintf" != "yes" ; then | |
819 | have_asprintf="no" | |
820 | fi | |
821 | cat > $TMPC << EOF | |
822 | #include <stdio.h> | |
823 | ||
824 | int main(int argc, char **argv) | |
825 | { | |
826 | return asprintf(NULL, "%s", "str") == 0; | |
827 | } | |
828 | EOF | |
829 | if compile_prog "" "" "have_asprintf"; then | |
830 | have_asprintf="yes" | |
831 | fi | |
832 | print_config "asprintf()" "$have_asprintf" | |
833 | ||
834 | if test "$have_vasprintf" != "yes" ; then | |
835 | have_vasprintf="no" | |
836 | fi | |
837 | cat > $TMPC << EOF | |
838 | #include <stdio.h> | |
839 | ||
840 | int main(int argc, char **argv) | |
841 | { | |
842 | return vasprintf(NULL, "%s", NULL) == 0; | |
843 | } | |
844 | EOF | |
845 | if compile_prog "" "" "have_vasprintf"; then | |
846 | have_vasprintf="yes" | |
847 | fi | |
848 | print_config "vasprintf()" "$have_vasprintf" | |
849 | ||
67bf9823 JA |
850 | ########################################## |
851 | # Linux fallocate probe | |
ca205a75 TK |
852 | if test "$linux_fallocate" != "yes" ; then |
853 | linux_fallocate="no" | |
854 | fi | |
67bf9823 JA |
855 | cat > $TMPC << EOF |
856 | #include <stdio.h> | |
aa6738a5 | 857 | #include <fcntl.h> |
67bf9823 JA |
858 | #include <linux/falloc.h> |
859 | int main(int argc, char **argv) | |
860 | { | |
861 | int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024); | |
862 | return r; | |
863 | } | |
864 | EOF | |
865 | if compile_prog "" "" "linux_fallocate"; then | |
866 | linux_fallocate="yes" | |
867 | fi | |
484b0b65 | 868 | print_config "Linux fallocate" "$linux_fallocate" |
67bf9823 JA |
869 | |
870 | ########################################## | |
871 | # POSIX fadvise probe | |
ca205a75 TK |
872 | if test "$posix_fadvise" != "yes" ; then |
873 | posix_fadvise="no" | |
874 | fi | |
67bf9823 JA |
875 | cat > $TMPC << EOF |
876 | #include <stdio.h> | |
877 | #include <fcntl.h> | |
878 | int main(int argc, char **argv) | |
879 | { | |
880 | int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL); | |
881 | return r; | |
882 | } | |
883 | EOF | |
884 | if compile_prog "" "" "posix_fadvise"; then | |
885 | posix_fadvise="yes" | |
886 | fi | |
484b0b65 | 887 | print_config "POSIX fadvise" "$posix_fadvise" |
67bf9823 JA |
888 | |
889 | ########################################## | |
890 | # POSIX fallocate probe | |
ca205a75 TK |
891 | if test "$posix_fallocate" != "yes" ; then |
892 | posix_fallocate="no" | |
893 | fi | |
67bf9823 JA |
894 | cat > $TMPC << EOF |
895 | #include <stdio.h> | |
896 | #include <fcntl.h> | |
897 | int main(int argc, char **argv) | |
898 | { | |
899 | int r = posix_fallocate(0, 0, 1024); | |
900 | return r; | |
901 | } | |
902 | EOF | |
903 | if compile_prog "" "" "posix_fallocate"; then | |
904 | posix_fallocate="yes" | |
905 | fi | |
484b0b65 | 906 | print_config "POSIX fallocate" "$posix_fallocate" |
67bf9823 JA |
907 | |
908 | ########################################## | |
909 | # sched_set/getaffinity 2 or 3 argument test | |
ca205a75 TK |
910 | if test "$linux_2arg_affinity" != "yes" ; then |
911 | linux_2arg_affinity="no" | |
912 | fi | |
913 | if test "$linux_3arg_affinity" != "yes" ; then | |
914 | linux_3arg_affinity="no" | |
915 | fi | |
67bf9823 | 916 | cat > $TMPC << EOF |
67bf9823 JA |
917 | #include <sched.h> |
918 | int main(int argc, char **argv) | |
919 | { | |
920 | cpu_set_t mask; | |
921 | return sched_setaffinity(0, sizeof(mask), &mask); | |
922 | } | |
923 | EOF | |
924 | if compile_prog "" "" "sched_setaffinity(,,)"; then | |
925 | linux_3arg_affinity="yes" | |
926 | else | |
927 | cat > $TMPC << EOF | |
67bf9823 JA |
928 | #include <sched.h> |
929 | int main(int argc, char **argv) | |
930 | { | |
931 | cpu_set_t mask; | |
932 | return sched_setaffinity(0, &mask); | |
933 | } | |
934 | EOF | |
935 | if compile_prog "" "" "sched_setaffinity(,)"; then | |
936 | linux_2arg_affinity="yes" | |
937 | fi | |
938 | fi | |
484b0b65 TK |
939 | print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity" |
940 | print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity" | |
67bf9823 JA |
941 | |
942 | ########################################## | |
943 | # clock_gettime probe | |
ca205a75 TK |
944 | if test "$clock_gettime" != "yes" ; then |
945 | clock_gettime="no" | |
946 | fi | |
67bf9823 JA |
947 | cat > $TMPC << EOF |
948 | #include <stdio.h> | |
949 | #include <time.h> | |
950 | int main(int argc, char **argv) | |
951 | { | |
952 | return clock_gettime(0, NULL); | |
953 | } | |
954 | EOF | |
955 | if compile_prog "" "" "clock_gettime"; then | |
956 | clock_gettime="yes" | |
957 | elif compile_prog "" "-lrt" "clock_gettime"; then | |
958 | clock_gettime="yes" | |
959 | LIBS="-lrt $LIBS" | |
960 | fi | |
484b0b65 | 961 | print_config "clock_gettime" "$clock_gettime" |
67bf9823 JA |
962 | |
963 | ########################################## | |
964 | # CLOCK_MONOTONIC probe | |
ca205a75 TK |
965 | if test "$clock_monotonic" != "yes" ; then |
966 | clock_monotonic="no" | |
967 | fi | |
67bf9823 JA |
968 | if test "$clock_gettime" = "yes" ; then |
969 | cat > $TMPC << EOF | |
970 | #include <stdio.h> | |
971 | #include <time.h> | |
972 | int main(int argc, char **argv) | |
973 | { | |
974 | return clock_gettime(CLOCK_MONOTONIC, NULL); | |
975 | } | |
976 | EOF | |
977 | if compile_prog "" "$LIBS" "clock monotonic"; then | |
978 | clock_monotonic="yes" | |
979 | fi | |
980 | fi | |
484b0b65 | 981 | print_config "CLOCK_MONOTONIC" "$clock_monotonic" |
67bf9823 | 982 | |
c544f604 SN |
983 | ########################################## |
984 | # CLOCK_MONOTONIC_RAW probe | |
ca205a75 TK |
985 | if test "$clock_monotonic_raw" != "yes" ; then |
986 | clock_monotonic_raw="no" | |
987 | fi | |
c544f604 SN |
988 | if test "$clock_gettime" = "yes" ; then |
989 | cat > $TMPC << EOF | |
990 | #include <stdio.h> | |
991 | #include <time.h> | |
992 | int main(int argc, char **argv) | |
993 | { | |
994 | return clock_gettime(CLOCK_MONOTONIC_RAW, NULL); | |
995 | } | |
996 | EOF | |
997 | if compile_prog "" "$LIBS" "clock monotonic"; then | |
998 | clock_monotonic_raw="yes" | |
999 | fi | |
1000 | fi | |
484b0b65 | 1001 | print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw" |
c544f604 | 1002 | |
67bf9823 JA |
1003 | ########################################## |
1004 | # CLOCK_MONOTONIC_PRECISE probe | |
ca205a75 TK |
1005 | if test "$clock_monotonic_precise" != "yes" ; then |
1006 | clock_monotonic_precise="no" | |
1007 | fi | |
67bf9823 JA |
1008 | if test "$clock_gettime" = "yes" ; then |
1009 | cat > $TMPC << EOF | |
1010 | #include <stdio.h> | |
1011 | #include <time.h> | |
1012 | int main(int argc, char **argv) | |
1013 | { | |
1014 | return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL); | |
1015 | } | |
1016 | EOF | |
1017 | if compile_prog "" "$LIBS" "clock monotonic precise"; then | |
1018 | clock_monotonic_precise="yes" | |
1019 | fi | |
1020 | fi | |
484b0b65 | 1021 | print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise" |
67bf9823 | 1022 | |
25f8227d JA |
1023 | ########################################## |
1024 | # clockid_t probe | |
ca205a75 TK |
1025 | if test "$clockid_t" != "yes" ; then |
1026 | clockid_t="no" | |
1027 | fi | |
25f8227d | 1028 | cat > $TMPC << EOF |
25f8227d | 1029 | #include <time.h> |
209c37b4 | 1030 | #include <string.h> |
25f8227d JA |
1031 | int main(int argc, char **argv) |
1032 | { | |
ccf2d89d | 1033 | volatile clockid_t cid; |
7fcad9e1 | 1034 | memset((void*)&cid, 0, sizeof(cid)); |
ccf2d89d | 1035 | return 0; |
25f8227d JA |
1036 | } |
1037 | EOF | |
1038 | if compile_prog "" "$LIBS" "clockid_t"; then | |
1039 | clockid_t="yes" | |
1040 | fi | |
484b0b65 | 1041 | print_config "clockid_t" "$clockid_t" |
25f8227d | 1042 | |
67bf9823 JA |
1043 | ########################################## |
1044 | # gettimeofday() probe | |
ca205a75 TK |
1045 | if test "$gettimeofday" != "yes" ; then |
1046 | gettimeofday="no" | |
1047 | fi | |
67bf9823 JA |
1048 | cat > $TMPC << EOF |
1049 | #include <sys/time.h> | |
1050 | #include <stdio.h> | |
1051 | int main(int argc, char **argv) | |
1052 | { | |
1053 | struct timeval tv; | |
1054 | return gettimeofday(&tv, NULL); | |
1055 | } | |
1056 | EOF | |
1057 | if compile_prog "" "" "gettimeofday"; then | |
1058 | gettimeofday="yes" | |
1059 | fi | |
484b0b65 | 1060 | print_config "gettimeofday" "$gettimeofday" |
67bf9823 JA |
1061 | |
1062 | ########################################## | |
1063 | # fdatasync() probe | |
ca205a75 TK |
1064 | if test "$fdatasync" != "yes" ; then |
1065 | fdatasync="no" | |
1066 | fi | |
67bf9823 JA |
1067 | cat > $TMPC << EOF |
1068 | #include <stdio.h> | |
1069 | #include <unistd.h> | |
1070 | int main(int argc, char **argv) | |
1071 | { | |
1072 | return fdatasync(0); | |
1073 | } | |
1074 | EOF | |
1075 | if compile_prog "" "" "fdatasync"; then | |
1076 | fdatasync="yes" | |
1077 | fi | |
484b0b65 | 1078 | print_config "fdatasync" "$fdatasync" |
67bf9823 JA |
1079 | |
1080 | ########################################## | |
1081 | # sync_file_range() probe | |
ca205a75 TK |
1082 | if test "$sync_file_range" != "yes" ; then |
1083 | sync_file_range="no" | |
1084 | fi | |
67bf9823 JA |
1085 | cat > $TMPC << EOF |
1086 | #include <stdio.h> | |
1087 | #include <unistd.h> | |
67bf9823 JA |
1088 | #include <fcntl.h> |
1089 | #include <linux/fs.h> | |
1090 | int main(int argc, char **argv) | |
1091 | { | |
1092 | unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | | |
1093 | SYNC_FILE_RANGE_WAIT_AFTER; | |
1094 | return sync_file_range(0, 0, 0, flags); | |
1095 | } | |
1096 | EOF | |
1097 | if compile_prog "" "" "sync_file_range"; then | |
1098 | sync_file_range="yes" | |
1099 | fi | |
484b0b65 | 1100 | print_config "sync_file_range" "$sync_file_range" |
67bf9823 JA |
1101 | |
1102 | ########################################## | |
1103 | # ext4 move extent probe | |
ca205a75 TK |
1104 | if test "$ext4_me" != "yes" ; then |
1105 | ext4_me="no" | |
1106 | fi | |
67bf9823 JA |
1107 | cat > $TMPC << EOF |
1108 | #include <fcntl.h> | |
1109 | #include <sys/ioctl.h> | |
1110 | int main(int argc, char **argv) | |
1111 | { | |
1112 | struct move_extent me; | |
1113 | return ioctl(0, EXT4_IOC_MOVE_EXT, &me); | |
1114 | } | |
1115 | EOF | |
c7165b8d JA |
1116 | if compile_prog "" "" "ext4 move extent" ; then |
1117 | ext4_me="yes" | |
1118 | elif test $targetos = "Linux" ; then | |
1119 | # On Linux, just default to it on and let it error at runtime if we really | |
1120 | # don't have it. None of my updated systems have it defined, but it does | |
1121 | # work. Takes a while to bubble back. | |
67bf9823 JA |
1122 | ext4_me="yes" |
1123 | fi | |
484b0b65 | 1124 | print_config "EXT4 move extent" "$ext4_me" |
67bf9823 JA |
1125 | |
1126 | ########################################## | |
1127 | # splice probe | |
ca205a75 TK |
1128 | if test "$linux_splice" != "yes" ; then |
1129 | linux_splice="no" | |
1130 | fi | |
67bf9823 | 1131 | cat > $TMPC << EOF |
67bf9823 JA |
1132 | #include <stdio.h> |
1133 | #include <fcntl.h> | |
1134 | int main(int argc, char **argv) | |
1135 | { | |
1136 | return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK); | |
1137 | } | |
1138 | EOF | |
1139 | if compile_prog "" "" "linux splice"; then | |
1140 | linux_splice="yes" | |
1141 | fi | |
484b0b65 | 1142 | print_config "Linux splice(2)" "$linux_splice" |
67bf9823 JA |
1143 | |
1144 | ########################################## | |
1145 | # GUASI probe | |
ca205a75 TK |
1146 | if test "$guasi" != "yes" ; then |
1147 | guasi="no" | |
1148 | fi | |
67bf9823 JA |
1149 | cat > $TMPC << EOF |
1150 | #include <guasi.h> | |
1151 | #include <guasi_syscalls.h> | |
1152 | int main(int argc, char **argv) | |
1153 | { | |
1154 | guasi_t ctx = guasi_create(0, 0, 0); | |
1155 | return 0; | |
1156 | } | |
1157 | EOF | |
1158 | if compile_prog "" "" "guasi"; then | |
1159 | guasi="yes" | |
1160 | fi | |
484b0b65 | 1161 | print_config "GUASI" "$guasi" |
67bf9823 | 1162 | |
67bf9823 JA |
1163 | ########################################## |
1164 | # libnuma probe | |
ca205a75 TK |
1165 | if test "$libnuma" != "yes" ; then |
1166 | libnuma="no" | |
1167 | fi | |
67bf9823 JA |
1168 | cat > $TMPC << EOF |
1169 | #include <numa.h> | |
1170 | int main(int argc, char **argv) | |
1171 | { | |
1172 | return numa_available(); | |
1173 | } | |
1174 | EOF | |
44462517 | 1175 | if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then |
67bf9823 JA |
1176 | libnuma="yes" |
1177 | LIBS="-lnuma $LIBS" | |
1178 | fi | |
484b0b65 | 1179 | print_config "libnuma" "$libnuma" |
67bf9823 | 1180 | |
50206d9b | 1181 | ########################################## |
ca205a75 | 1182 | # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes" |
50206d9b JA |
1183 | if test "$libnuma" = "yes" ; then |
1184 | libnuma_v2="no" | |
1185 | cat > $TMPC << EOF | |
1186 | #include <numa.h> | |
1187 | int main(int argc, char **argv) | |
1188 | { | |
1189 | struct bitmask *mask = numa_parse_nodestring(NULL); | |
61bde962 | 1190 | return mask->size == 0; |
50206d9b JA |
1191 | } |
1192 | EOF | |
1193 | if compile_prog "" "" "libnuma api"; then | |
1194 | libnuma_v2="yes" | |
1195 | fi | |
484b0b65 | 1196 | print_config "libnuma v2" "$libnuma_v2" |
50206d9b JA |
1197 | fi |
1198 | ||
67bf9823 JA |
1199 | ########################################## |
1200 | # strsep() probe | |
ca205a75 TK |
1201 | if test "$strsep" != "yes" ; then |
1202 | strsep="no" | |
1203 | fi | |
67bf9823 JA |
1204 | cat > $TMPC << EOF |
1205 | #include <string.h> | |
1206 | int main(int argc, char **argv) | |
1207 | { | |
ae156be6 JA |
1208 | static char *string = "This is a string"; |
1209 | strsep(&string, "needle"); | |
67bf9823 JA |
1210 | return 0; |
1211 | } | |
1212 | EOF | |
1213 | if compile_prog "" "" "strsep"; then | |
1214 | strsep="yes" | |
1215 | fi | |
484b0b65 | 1216 | print_config "strsep" "$strsep" |
67bf9823 | 1217 | |
9ad8da82 JA |
1218 | ########################################## |
1219 | # strcasestr() probe | |
ca205a75 TK |
1220 | if test "$strcasestr" != "yes" ; then |
1221 | strcasestr="no" | |
1222 | fi | |
9ad8da82 JA |
1223 | cat > $TMPC << EOF |
1224 | #include <string.h> | |
1225 | int main(int argc, char **argv) | |
1226 | { | |
aa6738a5 | 1227 | return strcasestr(argv[0], argv[1]) != NULL; |
9ad8da82 JA |
1228 | } |
1229 | EOF | |
1230 | if compile_prog "" "" "strcasestr"; then | |
1231 | strcasestr="yes" | |
1232 | fi | |
484b0b65 | 1233 | print_config "strcasestr" "$strcasestr" |
9ad8da82 | 1234 | |
5ad7be56 KD |
1235 | ########################################## |
1236 | # strlcat() probe | |
ca205a75 TK |
1237 | if test "$strlcat" != "yes" ; then |
1238 | strlcat="no" | |
1239 | fi | |
5ad7be56 KD |
1240 | cat > $TMPC << EOF |
1241 | #include <string.h> | |
1242 | int main(int argc, char **argv) | |
1243 | { | |
1244 | static char dst[64]; | |
1245 | static char *string = "This is a string"; | |
1246 | memset(dst, 0, sizeof(dst)); | |
1247 | strlcat(dst, string, sizeof(dst)); | |
1248 | return 0; | |
1249 | } | |
1250 | EOF | |
1251 | if compile_prog "" "" "strlcat"; then | |
1252 | strlcat="yes" | |
1253 | fi | |
484b0b65 | 1254 | print_config "strlcat" "$strlcat" |
5ad7be56 | 1255 | |
67bf9823 JA |
1256 | ########################################## |
1257 | # getopt_long_only() probe | |
ca205a75 TK |
1258 | if test "$getopt_long_only" != "yes" ; then |
1259 | getopt_long_only="no" | |
1260 | fi | |
67bf9823 JA |
1261 | cat > $TMPC << EOF |
1262 | #include <unistd.h> | |
1263 | #include <stdio.h> | |
aa6738a5 | 1264 | #include <getopt.h> |
67bf9823 JA |
1265 | int main(int argc, char **argv) |
1266 | { | |
1267 | int c = getopt_long_only(argc, argv, NULL, NULL, NULL); | |
1268 | return c; | |
1269 | } | |
1270 | EOF | |
1271 | if compile_prog "" "" "getopt_long_only"; then | |
1272 | getopt_long_only="yes" | |
1273 | fi | |
484b0b65 | 1274 | print_config "getopt_long_only()" "$getopt_long_only" |
67bf9823 JA |
1275 | |
1276 | ########################################## | |
1277 | # inet_aton() probe | |
ca205a75 TK |
1278 | if test "$inet_aton" != "yes" ; then |
1279 | inet_aton="no" | |
1280 | fi | |
67bf9823 JA |
1281 | cat > $TMPC << EOF |
1282 | #include <sys/socket.h> | |
1283 | #include <arpa/inet.h> | |
1284 | #include <stdio.h> | |
1285 | int main(int argc, char **argv) | |
1286 | { | |
1287 | struct in_addr in; | |
1288 | return inet_aton(NULL, &in); | |
1289 | } | |
1290 | EOF | |
1291 | if compile_prog "" "" "inet_aton"; then | |
1292 | inet_aton="yes" | |
1293 | fi | |
484b0b65 | 1294 | print_config "inet_aton" "$inet_aton" |
67bf9823 JA |
1295 | |
1296 | ########################################## | |
1297 | # socklen_t probe | |
ca205a75 TK |
1298 | if test "$socklen_t" != "yes" ; then |
1299 | socklen_t="no" | |
1300 | fi | |
67bf9823 | 1301 | cat > $TMPC << EOF |
f6482613 | 1302 | #include <sys/socket.h> |
67bf9823 JA |
1303 | int main(int argc, char **argv) |
1304 | { | |
1305 | socklen_t len = 0; | |
1306 | return len; | |
1307 | } | |
1308 | EOF | |
1309 | if compile_prog "" "" "socklen_t"; then | |
1310 | socklen_t="yes" | |
1311 | fi | |
484b0b65 | 1312 | print_config "socklen_t" "$socklen_t" |
67bf9823 JA |
1313 | |
1314 | ########################################## | |
1315 | # Whether or not __thread is supported for TLS | |
ca205a75 TK |
1316 | if test "$tls_thread" != "yes" ; then |
1317 | tls_thread="no" | |
1318 | fi | |
67bf9823 JA |
1319 | cat > $TMPC << EOF |
1320 | #include <stdio.h> | |
aa6738a5 | 1321 | static __thread int ret; |
67bf9823 JA |
1322 | int main(int argc, char **argv) |
1323 | { | |
1324 | return ret; | |
1325 | } | |
1326 | EOF | |
1327 | if compile_prog "" "" "__thread"; then | |
1328 | tls_thread="yes" | |
1329 | fi | |
484b0b65 | 1330 | print_config "__thread" "$tls_thread" |
67bf9823 | 1331 | |
91f94d5b | 1332 | ########################################## |
2639f056 | 1333 | # Check if we have required gtk/glib support for gfio |
ca205a75 TK |
1334 | if test "$gfio" != "yes" ; then |
1335 | gfio="no" | |
1336 | fi | |
ebec2094 | 1337 | if test "$gfio_check" = "yes" ; then |
91f94d5b JA |
1338 | cat > $TMPC << EOF |
1339 | #include <glib.h> | |
1340 | #include <cairo.h> | |
1341 | #include <gtk/gtk.h> | |
1342 | int main(void) | |
1343 | { | |
1344 | gdk_threads_enter(); | |
91f94d5b | 1345 | gdk_threads_leave(); |
b7a99316 | 1346 | |
ef2b61aa | 1347 | return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */ |
91f94d5b JA |
1348 | } |
1349 | EOF | |
4d1bc43e | 1350 | GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0) |
86719845 JA |
1351 | ORG_LDFLAGS=$LDFLAGS |
1352 | LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g) | |
91f94d5b JA |
1353 | if test "$?" != "0" ; then |
1354 | echo "configure: gtk and gthread not found" | |
1355 | exit 1 | |
1356 | fi | |
4d1bc43e | 1357 | GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0) |
91f94d5b JA |
1358 | if test "$?" != "0" ; then |
1359 | echo "configure: gtk and gthread not found" | |
1360 | exit 1 | |
1361 | fi | |
31ce8438 HG |
1362 | if ! ${cross_prefix}pkg-config --atleast-version 2.18.0 gtk+-2.0; then |
1363 | echo "GTK found, but need version 2.18 or higher" | |
1364 | gfio="no" | |
1365 | else | |
1366 | if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then | |
b7a99316 | 1367 | gfio="yes" |
86719845 | 1368 | GFIO_LIBS="$LIBS $GTK_LIBS" |
b7a99316 JA |
1369 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
1370 | else | |
31ce8438 | 1371 | echo "Please install gtk and gdk libraries" |
b7a99316 JA |
1372 | gfio="no" |
1373 | fi | |
91f94d5b | 1374 | fi |
86719845 | 1375 | LDFLAGS=$ORG_LDFLAGS |
91f94d5b JA |
1376 | fi |
1377 | ||
ebec2094 | 1378 | if test "$gfio_check" = "yes" ; then |
484b0b65 | 1379 | print_config "gtk 2.18 or higher" "$gfio" |
ebec2094 | 1380 | fi |
91f94d5b | 1381 | |
bda92394 | 1382 | ########################################## |
44404c5a | 1383 | # Check whether we have getrusage(RUSAGE_THREAD) |
ca205a75 TK |
1384 | if test "$rusage_thread" != "yes" ; then |
1385 | rusage_thread="no" | |
1386 | fi | |
44404c5a JA |
1387 | cat > $TMPC << EOF |
1388 | #include <sys/time.h> | |
1389 | #include <sys/resource.h> | |
1390 | int main(int argc, char **argv) | |
1391 | { | |
1392 | struct rusage ru; | |
1393 | getrusage(RUSAGE_THREAD, &ru); | |
1394 | return 0; | |
1395 | } | |
1396 | EOF | |
1397 | if compile_prog "" "" "RUSAGE_THREAD"; then | |
1398 | rusage_thread="yes" | |
1399 | fi | |
484b0b65 | 1400 | print_config "RUSAGE_THREAD" "$rusage_thread" |
44404c5a | 1401 | |
7e09a9f1 JA |
1402 | ########################################## |
1403 | # Check whether we have SCHED_IDLE | |
ca205a75 TK |
1404 | if test "$sched_idle" != "yes" ; then |
1405 | sched_idle="no" | |
1406 | fi | |
7e09a9f1 JA |
1407 | cat > $TMPC << EOF |
1408 | #include <sched.h> | |
1409 | int main(int argc, char **argv) | |
1410 | { | |
1411 | struct sched_param p; | |
1412 | return sched_setscheduler(0, SCHED_IDLE, &p); | |
1413 | } | |
1414 | EOF | |
1415 | if compile_prog "" "" "SCHED_IDLE"; then | |
1416 | sched_idle="yes" | |
1417 | fi | |
484b0b65 | 1418 | print_config "SCHED_IDLE" "$sched_idle" |
7e09a9f1 | 1419 | |
1eafa37a JA |
1420 | ########################################## |
1421 | # Check whether we have TCP_NODELAY | |
ca205a75 TK |
1422 | if test "$tcp_nodelay" != "yes" ; then |
1423 | tcp_nodelay="no" | |
1424 | fi | |
1eafa37a JA |
1425 | cat > $TMPC << EOF |
1426 | #include <stdio.h> | |
1427 | #include <sys/types.h> | |
1428 | #include <sys/socket.h> | |
1429 | #include <netinet/tcp.h> | |
1430 | int main(int argc, char **argv) | |
1431 | { | |
1432 | return getsockopt(0, 0, TCP_NODELAY, NULL, NULL); | |
1433 | } | |
1434 | EOF | |
1435 | if compile_prog "" "" "TCP_NODELAY"; then | |
1436 | tcp_nodelay="yes" | |
1437 | fi | |
484b0b65 | 1438 | print_config "TCP_NODELAY" "$tcp_nodelay" |
1eafa37a | 1439 | |
1008602c JA |
1440 | ########################################## |
1441 | # Check whether we have SO_SNDBUF | |
ca205a75 TK |
1442 | if test "$window_size" != "yes" ; then |
1443 | window_size="no" | |
1444 | fi | |
1008602c JA |
1445 | cat > $TMPC << EOF |
1446 | #include <stdio.h> | |
1447 | #include <sys/types.h> | |
1448 | #include <sys/socket.h> | |
1449 | #include <netinet/tcp.h> | |
1450 | int main(int argc, char **argv) | |
1451 | { | |
1452 | setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0); | |
1453 | setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0); | |
1454 | } | |
1455 | EOF | |
1456 | if compile_prog "" "" "SO_SNDBUF"; then | |
1457 | window_size="yes" | |
1458 | fi | |
484b0b65 | 1459 | print_config "Net engine window_size" "$window_size" |
1008602c | 1460 | |
e5f34d95 JA |
1461 | ########################################## |
1462 | # Check whether we have TCP_MAXSEG | |
ca205a75 TK |
1463 | if test "$mss" != "yes" ; then |
1464 | mss="no" | |
1465 | fi | |
e5f34d95 JA |
1466 | cat > $TMPC << EOF |
1467 | #include <stdio.h> | |
1468 | #include <sys/types.h> | |
1469 | #include <sys/socket.h> | |
1470 | #include <netinet/tcp.h> | |
1471 | #include <arpa/inet.h> | |
1472 | #include <netinet/in.h> | |
1473 | int main(int argc, char **argv) | |
1474 | { | |
1475 | return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0); | |
1476 | } | |
1477 | EOF | |
1478 | if compile_prog "" "" "TCP_MAXSEG"; then | |
1479 | mss="yes" | |
1480 | fi | |
484b0b65 | 1481 | print_config "TCP_MAXSEG" "$mss" |
e5f34d95 | 1482 | |
38b9354a JA |
1483 | ########################################## |
1484 | # Check whether we have RLIMIT_MEMLOCK | |
ca205a75 TK |
1485 | if test "$rlimit_memlock" != "yes" ; then |
1486 | rlimit_memlock="no" | |
1487 | fi | |
38b9354a JA |
1488 | cat > $TMPC << EOF |
1489 | #include <sys/time.h> | |
1490 | #include <sys/resource.h> | |
1491 | int main(int argc, char **argv) | |
1492 | { | |
1493 | struct rlimit rl; | |
1494 | return getrlimit(RLIMIT_MEMLOCK, &rl); | |
1495 | } | |
1496 | EOF | |
1497 | if compile_prog "" "" "RLIMIT_MEMLOCK"; then | |
1498 | rlimit_memlock="yes" | |
1499 | fi | |
484b0b65 | 1500 | print_config "RLIMIT_MEMLOCK" "$rlimit_memlock" |
38b9354a | 1501 | |
07fc0acd JA |
1502 | ########################################## |
1503 | # Check whether we have pwritev/preadv | |
ca205a75 TK |
1504 | if test "$pwritev" != "yes" ; then |
1505 | pwritev="no" | |
1506 | fi | |
07fc0acd JA |
1507 | cat > $TMPC << EOF |
1508 | #include <stdio.h> | |
1509 | #include <sys/uio.h> | |
1510 | int main(int argc, char **argv) | |
1511 | { | |
1512 | return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0); | |
1513 | } | |
1514 | EOF | |
1515 | if compile_prog "" "" "pwritev"; then | |
1516 | pwritev="yes" | |
1517 | fi | |
484b0b65 | 1518 | print_config "pwritev/preadv" "$pwritev" |
07fc0acd | 1519 | |
2cafffbe JA |
1520 | ########################################## |
1521 | # Check whether we have pwritev2/preadv2 | |
ca205a75 TK |
1522 | if test "$pwritev2" != "yes" ; then |
1523 | pwritev2="no" | |
1524 | fi | |
2cafffbe JA |
1525 | cat > $TMPC << EOF |
1526 | #include <stdio.h> | |
1527 | #include <sys/uio.h> | |
1528 | int main(int argc, char **argv) | |
1529 | { | |
1530 | return pwritev2(0, NULL, 1, 0, 0) + preadv2(0, NULL, 1, 0, 0); | |
1531 | } | |
1532 | EOF | |
1533 | if compile_prog "" "" "pwritev2"; then | |
1534 | pwritev2="yes" | |
1535 | fi | |
484b0b65 | 1536 | print_config "pwritev2/preadv2" "$pwritev2" |
2cafffbe | 1537 | |
ecad55e9 JA |
1538 | ########################################## |
1539 | # Check whether we have the required functions for ipv6 | |
ca205a75 TK |
1540 | if test "$ipv6" != "yes" ; then |
1541 | ipv6="no" | |
1542 | fi | |
ecad55e9 JA |
1543 | cat > $TMPC << EOF |
1544 | #include <sys/types.h> | |
1545 | #include <sys/socket.h> | |
d219028d | 1546 | #include <netinet/in.h> |
ecad55e9 JA |
1547 | #include <netdb.h> |
1548 | #include <stdio.h> | |
1549 | int main(int argc, char **argv) | |
1550 | { | |
1551 | struct addrinfo hints; | |
1552 | struct in6_addr addr; | |
1553 | int ret; | |
1554 | ||
1555 | ret = getaddrinfo(NULL, NULL, &hints, NULL); | |
1556 | freeaddrinfo(NULL); | |
1557 | printf("%s\n", gai_strerror(ret)); | |
1558 | addr = in6addr_any; | |
1559 | return 0; | |
1560 | } | |
1561 | EOF | |
1562 | if compile_prog "" "" "ipv6"; then | |
1563 | ipv6="yes" | |
1564 | fi | |
484b0b65 | 1565 | print_config "IPv6 helpers" "$ipv6" |
07fc0acd | 1566 | |
c2f6a13d LMB |
1567 | ########################################## |
1568 | # check for http | |
1569 | if test "$http" != "yes" ; then | |
1570 | http="no" | |
1571 | fi | |
9ee669fa DD |
1572 | # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer |
1573 | cat > $TMPC << EOF | |
1574 | #include <curl/curl.h> | |
1575 | #include <openssl/hmac.h> | |
1576 | ||
1577 | int main(int argc, char **argv) | |
1578 | { | |
1579 | CURL *curl; | |
1580 | HMAC_CTX *ctx; | |
1581 | ||
1582 | curl = curl_easy_init(); | |
1583 | curl_easy_cleanup(curl); | |
1584 | ||
1585 | ctx = HMAC_CTX_new(); | |
1586 | HMAC_CTX_reset(ctx); | |
1587 | HMAC_CTX_free(ctx); | |
1588 | return 0; | |
1589 | } | |
1590 | EOF | |
1591 | # openssl < 1.1.0 uses the HMAC_CTX type directly | |
1592 | cat > $TMPC2 << EOF | |
1593 | #include <curl/curl.h> | |
1594 | #include <openssl/hmac.h> | |
1595 | ||
1596 | int main(int argc, char **argv) | |
1597 | { | |
1598 | CURL *curl; | |
1599 | HMAC_CTX ctx; | |
1600 | ||
1601 | curl = curl_easy_init(); | |
1602 | curl_easy_cleanup(curl); | |
1603 | ||
1604 | HMAC_CTX_init(&ctx); | |
1605 | HMAC_CTX_cleanup(&ctx); | |
1606 | return 0; | |
1607 | } | |
1608 | EOF | |
1609 | if test "$disable_http" != "yes"; then | |
1610 | HTTP_LIBS="-lcurl -lssl -lcrypto" | |
1611 | if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then | |
b61a5f46 | 1612 | output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX" |
9ee669fa DD |
1613 | http="yes" |
1614 | LIBS="$HTTP_LIBS $LIBS" | |
1615 | elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then | |
1616 | http="yes" | |
1617 | LIBS="$HTTP_LIBS $LIBS" | |
0290c589 | 1618 | fi |
c2f6a13d LMB |
1619 | fi |
1620 | print_config "http engine" "$http" | |
1621 | ||
d5f9b0ea IF |
1622 | ########################################## |
1623 | # check for rados | |
1624 | if test "$rados" != "yes" ; then | |
1625 | rados="no" | |
1626 | fi | |
1627 | cat > $TMPC << EOF | |
1628 | #include <rados/librados.h> | |
1629 | ||
1630 | int main(int argc, char **argv) | |
1631 | { | |
1632 | rados_t cluster; | |
1633 | rados_ioctx_t io_ctx; | |
1634 | const char cluster_name[] = "ceph"; | |
1635 | const char user_name[] = "client.admin"; | |
1636 | const char pool[] = "rados"; | |
1637 | ||
1638 | /* The rados_create2 signature required was only introduced in ceph 0.65 */ | |
1639 | rados_create2(&cluster, cluster_name, user_name, 0); | |
1640 | rados_ioctx_create(cluster, pool, &io_ctx); | |
1641 | ||
1642 | return 0; | |
1643 | } | |
1644 | EOF | |
1645 | if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then | |
1646 | LIBS="-lrados $LIBS" | |
1647 | rados="yes" | |
1648 | fi | |
1649 | print_config "Rados engine" "$rados" | |
1650 | ||
fc5c0345 DG |
1651 | ########################################## |
1652 | # check for rbd | |
ca205a75 TK |
1653 | if test "$rbd" != "yes" ; then |
1654 | rbd="no" | |
1655 | fi | |
fc5c0345 DG |
1656 | cat > $TMPC << EOF |
1657 | #include <rbd/librbd.h> | |
1658 | ||
1659 | int main(int argc, char **argv) | |
1660 | { | |
fc5c0345 DG |
1661 | rados_t cluster; |
1662 | rados_ioctx_t io_ctx; | |
fb9bc6e3 SW |
1663 | const char cluster_name[] = "ceph"; |
1664 | const char user_name[] = "client.admin"; | |
fc5c0345 | 1665 | const char pool[] = "rbd"; |
fc5c0345 | 1666 | int major, minor, extra; |
fc5c0345 | 1667 | |
fb9bc6e3 SW |
1668 | rbd_version(&major, &minor, &extra); |
1669 | /* The rados_create2 signature required was only introduced in ceph 0.65 */ | |
1670 | rados_create2(&cluster, cluster_name, user_name, 0); | |
fc5c0345 | 1671 | rados_ioctx_create(cluster, pool, &io_ctx); |
fb9bc6e3 | 1672 | |
fc5c0345 DG |
1673 | return 0; |
1674 | } | |
1675 | EOF | |
ce18290e | 1676 | if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then |
fc5c0345 DG |
1677 | LIBS="-lrbd -lrados $LIBS" |
1678 | rbd="yes" | |
1679 | fi | |
484b0b65 | 1680 | print_config "Rados Block Device engine" "$rbd" |
fc5c0345 | 1681 | |
53b6c979 PL |
1682 | ########################################## |
1683 | # check for rbd_poll | |
ca205a75 TK |
1684 | if test "$rbd_poll" != "yes" ; then |
1685 | rbd_poll="no" | |
1686 | fi | |
53b6c979 PL |
1687 | if test "$rbd" = "yes"; then |
1688 | cat > $TMPC << EOF | |
1689 | #include <rbd/librbd.h> | |
1690 | #include <sys/eventfd.h> | |
1691 | ||
1692 | int main(int argc, char **argv) | |
1693 | { | |
1694 | rbd_image_t image; | |
1695 | rbd_completion_t comp; | |
1696 | ||
1697 | int fd = eventfd(0, EFD_NONBLOCK); | |
1698 | rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD); | |
1699 | rbd_poll_io_events(image, comp, 1); | |
1700 | ||
1701 | return 0; | |
1702 | } | |
1703 | EOF | |
1704 | if compile_prog "" "-lrbd -lrados" "rbd"; then | |
1705 | rbd_poll="yes" | |
1706 | fi | |
484b0b65 | 1707 | print_config "rbd_poll" "$rbd_poll" |
53b6c979 PL |
1708 | fi |
1709 | ||
903b2812 | 1710 | ########################################## |
6266dd72 | 1711 | # check for rbd_invalidate_cache() |
ca205a75 TK |
1712 | if test "$rbd_inval" != "yes" ; then |
1713 | rbd_inval="no" | |
1714 | fi | |
903b2812 JA |
1715 | if test "$rbd" = "yes"; then |
1716 | cat > $TMPC << EOF | |
1717 | #include <rbd/librbd.h> | |
1718 | ||
1719 | int main(int argc, char **argv) | |
1720 | { | |
1721 | rbd_image_t image; | |
1722 | ||
1723 | return rbd_invalidate_cache(image); | |
1724 | } | |
1725 | EOF | |
1726 | if compile_prog "" "-lrbd -lrados" "rbd"; then | |
1727 | rbd_inval="yes" | |
1728 | fi | |
484b0b65 | 1729 | print_config "rbd_invalidate_cache" "$rbd_inval" |
903b2812 JA |
1730 | fi |
1731 | ||
2e802282 JA |
1732 | ########################################## |
1733 | # Check whether we have setvbuf | |
ca205a75 TK |
1734 | if test "$setvbuf" != "yes" ; then |
1735 | setvbuf="no" | |
1736 | fi | |
2e802282 JA |
1737 | cat > $TMPC << EOF |
1738 | #include <stdio.h> | |
1739 | int main(int argc, char **argv) | |
1740 | { | |
1741 | FILE *f = NULL; | |
1742 | char buf[80]; | |
1743 | setvbuf(f, buf, _IOFBF, sizeof(buf)); | |
1744 | return 0; | |
1745 | } | |
1746 | EOF | |
1747 | if compile_prog "" "" "setvbuf"; then | |
1748 | setvbuf="yes" | |
1749 | fi | |
484b0b65 | 1750 | print_config "setvbuf" "$setvbuf" |
fc5c0345 | 1751 | |
bda92394 | 1752 | ########################################## |
6e7d7dfb | 1753 | # check for gfapi |
ca205a75 TK |
1754 | if test "$gfapi" != "yes" ; then |
1755 | gfapi="no" | |
1756 | fi | |
6e7d7dfb | 1757 | cat > $TMPC << EOF |
1758 | #include <glusterfs/api/glfs.h> | |
1759 | ||
1760 | int main(int argc, char **argv) | |
1761 | { | |
6e7d7dfb | 1762 | glfs_t *g = glfs_new("foo"); |
1763 | ||
1764 | return 0; | |
1765 | } | |
1766 | EOF | |
ce18290e | 1767 | if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
6e7d7dfb | 1768 | LIBS="-lgfapi -lglusterfs $LIBS" |
1769 | gfapi="yes" | |
1770 | fi | |
484b0b65 | 1771 | print_config "Gluster API engine" "$gfapi" |
6e7d7dfb | 1772 | |
6fa14b99 | 1773 | ########################################## |
ca205a75 | 1774 | # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes" |
6876c98c | 1775 | if test "$gfapi" = "yes" ; then |
6fa14b99 | 1776 | gf_fadvise="no" |
1777 | cat > $TMPC << EOF | |
1778 | #include <glusterfs/api/glfs.h> | |
1779 | ||
1780 | int main(int argc, char **argv) | |
1781 | { | |
1782 | struct glfs_fd *fd; | |
1783 | int ret = glfs_fadvise(fd, 0, 0, 1); | |
1784 | ||
1785 | return 0; | |
1786 | } | |
1787 | EOF | |
6fa14b99 | 1788 | if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
1789 | gf_fadvise="yes" | |
1790 | fi | |
484b0b65 | 1791 | print_config "Gluster API use fadvise" "$gf_fadvise" |
6876c98c JA |
1792 | fi |
1793 | ||
ce4d13ca JA |
1794 | ########################################## |
1795 | # check for newer gfapi | |
1796 | if test "$gfapi" = "yes" ; then | |
1797 | gf_new="no" | |
1798 | cat > $TMPC << EOF | |
1799 | #include <glusterfs/api/glfs.h> | |
1800 | ||
1801 | int main(int argc, char **argv) | |
1802 | { | |
1803 | return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL); | |
1804 | } | |
1805 | EOF | |
1806 | if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then | |
1807 | gf_new="yes" | |
1808 | fi | |
1809 | print_config "Gluster new API" "$gf_new" | |
1810 | fi | |
1811 | ||
6876c98c JA |
1812 | ########################################## |
1813 | # check for gfapi trim support | |
ca205a75 TK |
1814 | if test "$gf_trim" != "yes" ; then |
1815 | gf_trim="no" | |
1816 | fi | |
6876c98c JA |
1817 | if test "$gfapi" = "yes" ; then |
1818 | cat > $TMPC << EOF | |
1819 | #include <glusterfs/api/glfs.h> | |
1820 | ||
1821 | int main(int argc, char **argv) | |
1822 | { | |
1823 | return glfs_discard_async(NULL, 0, 0); | |
1824 | } | |
1825 | EOF | |
1826 | if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then | |
1827 | gf_trim="yes" | |
1828 | fi | |
484b0b65 | 1829 | print_config "Gluster API trim support" "$gf_trim" |
6876c98c | 1830 | fi |
fc5c0345 | 1831 | |
81795ce3 CE |
1832 | ########################################## |
1833 | # Check if we support stckf on s390 | |
ca205a75 TK |
1834 | if test "$s390_z196_facilities" != "yes" ; then |
1835 | s390_z196_facilities="no" | |
1836 | fi | |
81795ce3 CE |
1837 | cat > $TMPC << EOF |
1838 | #define STFLE_BITS_Z196 45 /* various z196 facilities ... */ | |
1839 | int main(int argc, char **argv) | |
1840 | { | |
1841 | /* We want just 1 double word to be returned. */ | |
1842 | register unsigned long reg0 asm("0") = 0; | |
1843 | unsigned long stfle_bits; | |
1844 | asm volatile(".machine push" "\n\t" | |
1845 | ".machine \"z9-109\"" "\n\t" | |
1846 | "stfle %0" "\n\t" | |
1847 | ".machine pop" "\n" | |
1848 | : "=QS" (stfle_bits), "+d" (reg0) | |
1849 | : : "cc"); | |
1850 | ||
1851 | if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0) | |
1852 | return 0; | |
1853 | else | |
1854 | return -1; | |
1855 | } | |
1856 | EOF | |
1857 | if compile_prog "" "" "s390_z196_facilities"; then | |
1858 | $TMPE | |
6a2c9363 | 1859 | if [ $? -eq 0 ]; then |
81795ce3 CE |
1860 | s390_z196_facilities="yes" |
1861 | fi | |
1862 | fi | |
484b0b65 | 1863 | print_config "s390_z196_facilities" "$s390_z196_facilities" |
1b10477b MM |
1864 | |
1865 | ########################################## | |
1866 | # Check if we have required environment variables configured for libhdfs | |
1867 | if test "$libhdfs" = "yes" ; then | |
1868 | hdfs_conf_error=0 | |
1869 | if test "$JAVA_HOME" = "" ; then | |
1870 | echo "configure: JAVA_HOME should be defined to jdk/jvm path" | |
1871 | hdfs_conf_error=1 | |
1872 | fi | |
1873 | if test "$FIO_LIBHDFS_INCLUDE" = "" ; then | |
1874 | echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path" | |
1875 | hdfs_conf_error=1 | |
1876 | fi | |
1877 | if test "$FIO_LIBHDFS_LIB" = "" ; then | |
1878 | echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path" | |
1879 | hdfs_conf_error=1 | |
1880 | fi | |
1881 | if test "$hdfs_conf_error" = "1" ; then | |
1882 | exit 1 | |
1883 | fi | |
247e5436 JA |
1884 | FIO_HDFS_CPU=$cpu |
1885 | if test "$FIO_HDFS_CPU" = "x86_64" ; then | |
1886 | FIO_HDFS_CPU="amd64" | |
1887 | fi | |
1b10477b | 1888 | fi |
484b0b65 | 1889 | print_config "HDFS engine" "$libhdfs" |
1b10477b | 1890 | |
b8116a87 DE |
1891 | ########################################## |
1892 | # Check whether we have MTD | |
ca205a75 TK |
1893 | if test "$mtd" != "yes" ; then |
1894 | mtd="no" | |
1895 | fi | |
b8116a87 | 1896 | cat > $TMPC << EOF |
0e1c454a | 1897 | #include <string.h> |
b8116a87 DE |
1898 | #include <mtd/mtd-user.h> |
1899 | #include <sys/ioctl.h> | |
1900 | int main(int argc, char **argv) | |
1901 | { | |
0e1c454a | 1902 | struct mtd_write_req ops; |
b8116a87 | 1903 | struct mtd_info_user info; |
0e1c454a | 1904 | memset(&ops, 0, sizeof(ops)); |
400cd0ff | 1905 | info.type = MTD_MLCNANDFLASH; |
b8116a87 DE |
1906 | return ioctl(0, MEMGETINFO, &info); |
1907 | } | |
1908 | EOF | |
1909 | if compile_prog "" "" "mtd"; then | |
1910 | mtd="yes" | |
1911 | fi | |
484b0b65 | 1912 | print_config "MTD" "$mtd" |
b8116a87 | 1913 | |
3ee2a3c1 DJ |
1914 | ########################################## |
1915 | # Check whether we have libpmem | |
ca205a75 TK |
1916 | if test "$libpmem" != "yes" ; then |
1917 | libpmem="no" | |
1918 | fi | |
3ee2a3c1 DJ |
1919 | cat > $TMPC << EOF |
1920 | #include <libpmem.h> | |
1921 | int main(int argc, char **argv) | |
1922 | { | |
1923 | int rc; | |
1924 | rc = pmem_is_pmem(0, 0); | |
1925 | return 0; | |
1926 | } | |
1927 | EOF | |
1928 | if compile_prog "" "-lpmem" "libpmem"; then | |
1929 | libpmem="yes" | |
cf8775b8 | 1930 | LIBS="-lpmem $LIBS" |
3ee2a3c1 | 1931 | fi |
484b0b65 | 1932 | print_config "libpmem" "$libpmem" |
3ee2a3c1 DJ |
1933 | |
1934 | ########################################## | |
1935 | # Check whether we have libpmemblk | |
cf8775b8 | 1936 | # libpmem is a prerequisite |
ca205a75 TK |
1937 | if test "$libpmemblk" != "yes" ; then |
1938 | libpmemblk="no" | |
1939 | fi | |
cf8775b8 RE |
1940 | if test "$libpmem" = "yes"; then |
1941 | cat > $TMPC << EOF | |
3ee2a3c1 DJ |
1942 | #include <libpmemblk.h> |
1943 | int main(int argc, char **argv) | |
1944 | { | |
cf8775b8 RE |
1945 | PMEMblkpool *pbp; |
1946 | pbp = pmemblk_open("", 0); | |
3ee2a3c1 DJ |
1947 | return 0; |
1948 | } | |
1949 | EOF | |
cf8775b8 RE |
1950 | if compile_prog "" "-lpmemblk" "libpmemblk"; then |
1951 | libpmemblk="yes" | |
1952 | LIBS="-lpmemblk $LIBS" | |
1953 | fi | |
3ee2a3c1 | 1954 | fi |
484b0b65 | 1955 | print_config "libpmemblk" "$libpmemblk" |
3ee2a3c1 | 1956 | |
cf8775b8 | 1957 | # Choose the ioengines |
3ee2a3c1 | 1958 | if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then |
ae0db592 | 1959 | pmem="yes" |
3ee2a3c1 DJ |
1960 | devdax="yes" |
1961 | if test "$libpmemblk" = "yes"; then | |
1962 | pmemblk="yes" | |
1963 | fi | |
1964 | fi | |
1965 | ||
43f3cec2 BB |
1966 | ########################################## |
1967 | # Report whether pmemblk engine is enabled | |
363a5f65 | 1968 | print_config "PMDK pmemblk engine" "$pmemblk" |
43f3cec2 | 1969 | |
cbb15e42 DJ |
1970 | ########################################## |
1971 | # Report whether dev-dax engine is enabled | |
363a5f65 | 1972 | print_config "PMDK dev-dax engine" "$devdax" |
cbb15e42 | 1973 | |
ae0db592 TI |
1974 | ########################################## |
1975 | # Report whether libpmem engine is enabled | |
363a5f65 | 1976 | print_config "PMDK libpmem engine" "$pmem" |
ae0db592 | 1977 | |
a40e7a59 GB |
1978 | ########################################## |
1979 | # Check whether we support DDN's IME | |
1980 | if test "$libime" != "yes" ; then | |
1981 | libime="no" | |
1982 | fi | |
1983 | cat > $TMPC << EOF | |
1984 | #include <ime_native.h> | |
1985 | int main(int argc, char **argv) | |
1986 | { | |
1987 | int rc; | |
1988 | ime_native_init(); | |
1989 | rc = ime_native_finalize(); | |
1990 | return 0; | |
1991 | } | |
1992 | EOF | |
1993 | if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then | |
1994 | libime="yes" | |
1995 | CFLAGS="-I${ime_path}/include $CFLAGS" | |
1996 | LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS" | |
1997 | LIBS="-lim_client $LIBS" | |
1998 | fi | |
1999 | print_config "DDN's Infinite Memory Engine" "$libime" | |
2000 | ||
247ef2aa KZ |
2001 | ########################################## |
2002 | # Check if we have required environment variables configured for libiscsi | |
2003 | if test "$libiscsi" = "yes" ; then | |
2004 | if $(pkg-config --atleast-version=1.9.0 libiscsi); then | |
2005 | libiscsi="yes" | |
2006 | libiscsi_cflags=$(pkg-config --cflags libiscsi) | |
2007 | libiscsi_libs=$(pkg-config --libs libiscsi) | |
2008 | else | |
2009 | if test "$libiscsi" = "yes" ; then | |
2010 | echo "libiscsi" "Install libiscsi >= 1.9.0" | |
2011 | fi | |
2012 | libiscsi="no" | |
2013 | fi | |
2014 | fi | |
2015 | print_config "iscsi engine" "$libiscsi" | |
2016 | ||
bda92394 | 2017 | ########################################## |
b470a02c SC |
2018 | # Check if we have lex/yacc available |
2019 | yacc="no" | |
e7b2c7a3 | 2020 | yacc_is_bison="no" |
b470a02c SC |
2021 | lex="no" |
2022 | arith="no" | |
de26b824 | 2023 | if test "$disable_lex" = "no" || test -z "$disable_lex" ; then |
cf6dd80e | 2024 | if test "$targetos" != "SunOS" ; then |
e7b2c7a3 | 2025 | LEX=$(which lex 2> /dev/null) |
b470a02c SC |
2026 | if test -x "$LEX" ; then |
2027 | lex="yes" | |
2028 | fi | |
7e0049e9 | 2029 | YACC=$(which bison 2> /dev/null) |
b470a02c SC |
2030 | if test -x "$YACC" ; then |
2031 | yacc="yes" | |
7e0049e9 | 2032 | yacc_is_bison="yes" |
e7b2c7a3 | 2033 | else |
7e0049e9 | 2034 | YACC=$(which yacc 2> /dev/null) |
e7b2c7a3 JA |
2035 | if test -x "$YACC" ; then |
2036 | yacc="yes" | |
e7b2c7a3 | 2037 | fi |
b470a02c SC |
2038 | fi |
2039 | if test "$yacc" = "yes" && test "$lex" = "yes" ; then | |
2040 | arith="yes" | |
2041 | fi | |
2042 | ||
2043 | if test "$arith" = "yes" ; then | |
2044 | cat > $TMPC << EOF | |
2045 | extern int yywrap(void); | |
2046 | ||
2047 | int main(int argc, char **argv) | |
2048 | { | |
2049 | yywrap(); | |
2050 | return 0; | |
2051 | } | |
2052 | EOF | |
719cda03 JA |
2053 | if compile_prog "" "-ll" "lex"; then |
2054 | LIBS="-ll $LIBS" | |
b470a02c SC |
2055 | else |
2056 | arith="no" | |
2057 | fi | |
2058 | fi | |
cf6dd80e | 2059 | fi |
a655bbc4 | 2060 | fi |
b470a02c | 2061 | |
63bda378 JA |
2062 | # Check if lex fails using -o |
2063 | if test "$arith" = "yes" ; then | |
daf705b5 JA |
2064 | if test "$force_no_lex_o" = "yes" ; then |
2065 | lex_use_o="no" | |
2066 | else | |
63bda378 JA |
2067 | $LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null |
2068 | if test "$?" = "0" ; then | |
2069 | lex_use_o="yes" | |
2070 | else | |
2071 | lex_use_o="no" | |
2072 | fi | |
2073 | fi | |
daf705b5 | 2074 | fi |
63bda378 | 2075 | |
484b0b65 | 2076 | print_config "lex/yacc for arithmetic" "$arith" |
b470a02c | 2077 | |
aae599ba JA |
2078 | ########################################## |
2079 | # Check whether we have setmntent/getmntent | |
ca205a75 TK |
2080 | if test "$getmntent" != "yes" ; then |
2081 | getmntent="no" | |
2082 | fi | |
aae599ba JA |
2083 | cat > $TMPC << EOF |
2084 | #include <stdio.h> | |
2085 | #include <mntent.h> | |
2086 | int main(int argc, char **argv) | |
2087 | { | |
2088 | FILE *mtab = setmntent(NULL, "r"); | |
2089 | struct mntent *mnt = getmntent(mtab); | |
1581b82a | 2090 | endmntent(mtab); |
aae599ba JA |
2091 | return 0; |
2092 | } | |
2093 | EOF | |
2094 | if compile_prog "" "" "getmntent"; then | |
2095 | getmntent="yes" | |
2096 | fi | |
484b0b65 | 2097 | print_config "getmntent" "$getmntent" |
aae599ba | 2098 | |
e7e136da TK |
2099 | ########################################## |
2100 | # Check whether we have getmntinfo | |
b765bec0 TK |
2101 | # These are originally added for BSDs, but may also work |
2102 | # on other operating systems with getmntinfo(3). | |
2103 | ||
2104 | # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD. | |
2105 | # Note that NetBSD needs -Werror to catch warning as error. | |
ca205a75 TK |
2106 | if test "$getmntinfo" != "yes" ; then |
2107 | getmntinfo="no" | |
2108 | fi | |
e7e136da TK |
2109 | cat > $TMPC << EOF |
2110 | #include <stdio.h> | |
2111 | #include <sys/param.h> | |
2112 | #include <sys/mount.h> | |
2113 | int main(int argc, char **argv) | |
2114 | { | |
9ada751d | 2115 | struct statfs *st; |
e7e136da TK |
2116 | return getmntinfo(&st, MNT_NOWAIT); |
2117 | } | |
2118 | EOF | |
b765bec0 | 2119 | if compile_prog "-Werror" "" "getmntinfo"; then |
e7e136da TK |
2120 | getmntinfo="yes" |
2121 | fi | |
484b0b65 | 2122 | print_config "getmntinfo" "$getmntinfo" |
e7e136da | 2123 | |
b765bec0 | 2124 | # getmntinfo(3) for NetBSD. |
ca205a75 TK |
2125 | if test "$getmntinfo_statvfs" != "yes" ; then |
2126 | getmntinfo_statvfs="no" | |
2127 | fi | |
b765bec0 TK |
2128 | cat > $TMPC << EOF |
2129 | #include <stdio.h> | |
2130 | #include <sys/statvfs.h> | |
2131 | int main(int argc, char **argv) | |
2132 | { | |
2133 | struct statvfs *st; | |
2134 | return getmntinfo(&st, MNT_NOWAIT); | |
2135 | } | |
2136 | EOF | |
2137 | # Skip the test if the one with statfs arg is detected. | |
2138 | if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then | |
2139 | getmntinfo_statvfs="yes" | |
484b0b65 | 2140 | print_config "getmntinfo_statvfs" "$getmntinfo_statvfs" |
b765bec0 TK |
2141 | fi |
2142 | ||
5018f79f AH |
2143 | ########################################## |
2144 | # Check whether we have _Static_assert | |
ca205a75 TK |
2145 | if test "$static_assert" != "yes" ; then |
2146 | static_assert="no" | |
2147 | fi | |
5018f79f AH |
2148 | cat > $TMPC << EOF |
2149 | #include <assert.h> | |
94815a5c | 2150 | #include <stdlib.h> |
51b4c81e | 2151 | #include <stddef.h> |
94815a5c JA |
2152 | |
2153 | struct foo { | |
2154 | int a, b; | |
2155 | }; | |
2156 | ||
5018f79f AH |
2157 | int main(int argc, char **argv) |
2158 | { | |
94815a5c | 2159 | _Static_assert(offsetof(struct foo, a) == 0 , "Check"); |
5018f79f AH |
2160 | return 0 ; |
2161 | } | |
2162 | EOF | |
2163 | if compile_prog "" "" "static_assert"; then | |
2164 | static_assert="yes" | |
2165 | fi | |
484b0b65 | 2166 | print_config "Static Assert" "$static_assert" |
e39c0676 JA |
2167 | |
2168 | ########################################## | |
2169 | # Check whether we have bool / stdbool.h | |
ca205a75 TK |
2170 | if test "$have_bool" != "yes" ; then |
2171 | have_bool="no" | |
2172 | fi | |
e39c0676 JA |
2173 | cat > $TMPC << EOF |
2174 | #include <stdbool.h> | |
2175 | int main(int argc, char **argv) | |
2176 | { | |
2177 | bool var = true; | |
2178 | return var != false; | |
2179 | } | |
2180 | EOF | |
2181 | if compile_prog "" "" "bool"; then | |
2182 | have_bool="yes" | |
2183 | fi | |
484b0b65 | 2184 | print_config "bool" "$have_bool" |
e39c0676 | 2185 | |
b29c71c4 JA |
2186 | ########################################## |
2187 | # Check whether we have strndup() | |
107ad008 | 2188 | strndup="no" |
b29c71c4 JA |
2189 | cat > $TMPC << EOF |
2190 | #include <string.h> | |
2191 | #include <stdlib.h> | |
2192 | int main(int argc, char **argv) | |
2193 | { | |
2194 | char *res = strndup("test string", 8); | |
2195 | ||
2196 | free(res); | |
2197 | return 0; | |
2198 | } | |
2199 | EOF | |
2200 | if compile_prog "" "" "strndup"; then | |
2201 | strndup="yes" | |
2202 | fi | |
2203 | print_config "strndup" "$strndup" | |
2204 | ||
214e2d56 | 2205 | ########################################## |
0ffccc21 BVA |
2206 | # <valgrind/drd.h> probe |
2207 | # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is | |
2208 | # also available but not the other way around. | |
2209 | if test "$valgrind_dev" != "yes" ; then | |
2210 | valgrind_dev="no" | |
2211 | fi | |
2212 | cat > $TMPC << EOF | |
2213 | #include <valgrind/drd.h> | |
2214 | int main(int argc, char **argv) | |
2215 | { | |
2216 | return 0; | |
2217 | } | |
2218 | EOF | |
2219 | if compile_prog "" "" "valgrind_dev"; then | |
2220 | valgrind_dev="yes" | |
2221 | fi | |
2222 | print_config "Valgrind headers" "$valgrind_dev" | |
2223 | ||
a76e1995 BVA |
2224 | ########################################## |
2225 | # <linux/blkzoned.h> probe | |
2226 | if test "$linux_blkzoned" != "yes" ; then | |
2227 | linux_blkzoned="no" | |
2228 | fi | |
2229 | cat > $TMPC << EOF | |
2230 | #include <linux/blkzoned.h> | |
2231 | int main(int argc, char **argv) | |
2232 | { | |
2233 | return 0; | |
2234 | } | |
2235 | EOF | |
2236 | if compile_prog "" "" "linux_blkzoned"; then | |
2237 | linux_blkzoned="yes" | |
2238 | fi | |
2239 | print_config "Zoned block device support" "$linux_blkzoned" | |
2240 | ||
2241 | ########################################## | |
214e2d56 | 2242 | # check march=armv8-a+crc+crypto |
ca205a75 TK |
2243 | if test "$march_armv8_a_crc_crypto" != "yes" ; then |
2244 | march_armv8_a_crc_crypto="no" | |
2245 | fi | |
214e2d56 | 2246 | if test "$cpu" = "arm64" ; then |
2247 | cat > $TMPC <<EOF | |
9b153dc2 TT |
2248 | #include <arm_acle.h> |
2249 | #include <arm_neon.h> | |
58828d07 | 2250 | #include <sys/auxv.h> |
9b153dc2 | 2251 | |
214e2d56 | 2252 | int main(void) |
2253 | { | |
58828d07 SW |
2254 | /* Can we also do a runtime probe? */ |
2255 | #if __linux__ | |
2256 | return getauxval(AT_HWCAP); | |
2257 | #else | |
2258 | # error "Don't know how to do runtime probe for ARM CRC32c" | |
2259 | #endif | |
214e2d56 | 2260 | } |
2261 | EOF | |
58828d07 | 2262 | if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then |
214e2d56 | 2263 | march_armv8_a_crc_crypto="yes" |
58828d07 | 2264 | CFLAGS="$CFLAGS -march=armv8-a+crc+crypto" |
9f75af77 | 2265 | march_set="yes" |
214e2d56 | 2266 | fi |
2267 | fi | |
484b0b65 | 2268 | print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto" |
214e2d56 | 2269 | |
03553853 YR |
2270 | ########################################## |
2271 | # cuda probe | |
d418fa90 TK |
2272 | if test "$cuda" != "yes" ; then |
2273 | cuda="no" | |
2274 | fi | |
03553853 YR |
2275 | cat > $TMPC << EOF |
2276 | #include <cuda.h> | |
2277 | int main(int argc, char **argv) | |
2278 | { | |
2279 | return cuInit(0); | |
2280 | } | |
2281 | EOF | |
4bd2c8b9 | 2282 | if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then |
03553853 YR |
2283 | cuda="yes" |
2284 | LIBS="-lcuda $LIBS" | |
2285 | fi | |
484b0b65 | 2286 | print_config "cuda" "$cuda" |
214e2d56 | 2287 | |
4252396e JA |
2288 | ########################################## |
2289 | # mkdir() probe. mingw apparently has a one-argument mkdir :/ | |
2290 | mkdir_two="no" | |
2291 | cat > $TMPC << EOF | |
2292 | #include <sys/stat.h> | |
2293 | #include <sys/types.h> | |
2294 | int main(int argc, char **argv) | |
2295 | { | |
2296 | return mkdir("/tmp/bla", 0600); | |
2297 | } | |
2298 | EOF | |
2299 | if compile_prog "" "" "mkdir(a, b)"; then | |
2300 | mkdir_two="yes" | |
2301 | fi | |
2302 | print_config "mkdir(a, b)" "$mkdir_two" | |
2303 | ||
a817dc3b JA |
2304 | ########################################## |
2305 | # check for cc -march=native | |
2306 | build_native="no" | |
2307 | cat > $TMPC << EOF | |
2308 | int main(int argc, char **argv) | |
2309 | { | |
2310 | return 0; | |
2311 | } | |
2312 | EOF | |
c922e0b0 SW |
2313 | if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \ |
2314 | compile_prog "-march=native" "" "march=native"; then | |
a817dc3b JA |
2315 | build_native="yes" |
2316 | fi | |
2317 | print_config "Build march=native" "$build_native" | |
2318 | ||
b8b0e1ee TK |
2319 | ########################################## |
2320 | # check for -lcunit | |
2321 | if test "$cunit" != "yes" ; then | |
2322 | cunit="no" | |
2323 | fi | |
2324 | cat > $TMPC << EOF | |
2325 | #include <CUnit/CUnit.h> | |
2326 | #include <CUnit/Basic.h> | |
2327 | int main(void) | |
2328 | { | |
2329 | if (CU_initialize_registry() != CUE_SUCCESS) | |
2330 | return CU_get_error(); | |
2331 | CU_basic_set_mode(CU_BRM_VERBOSE); | |
2332 | CU_basic_run_tests(); | |
2333 | CU_cleanup_registry(); | |
2334 | return CU_get_error(); | |
2335 | } | |
2336 | EOF | |
2337 | if compile_prog "" "-lcunit" "CUnit"; then | |
2338 | cunit="yes" | |
2339 | fi | |
2340 | print_config "CUnit" "$cunit" | |
2341 | ||
57fa61f0 JA |
2342 | ########################################## |
2343 | # check for __kernel_rwf_t | |
2344 | __kernel_rwf_t="no" | |
2345 | cat > $TMPC << EOF | |
2346 | #include <linux/fs.h> | |
2347 | int main(int argc, char **argv) | |
2348 | { | |
2349 | __kernel_rwf_t x; | |
2350 | x = 0; | |
2351 | return x; | |
2352 | } | |
2353 | EOF | |
2354 | if compile_prog "" "" "__kernel_rwf_t"; then | |
2355 | __kernel_rwf_t="yes" | |
2356 | fi | |
2357 | print_config "__kernel_rwf_t" "$__kernel_rwf_t" | |
2358 | ||
71144e67 JA |
2359 | ########################################## |
2360 | # check if gcc has -Wimplicit-fallthrough | |
2361 | fallthrough="no" | |
2362 | cat > $TMPC << EOF | |
2363 | int main(int argc, char **argv) | |
2364 | { | |
2365 | return 0; | |
2366 | } | |
2367 | EOF | |
2368 | if compile_prog "-Wimplicit-fallthrough" "" "-Wimplicit-fallthrough"; then | |
2369 | fallthrough="yes" | |
2370 | fi | |
2371 | print_config "-Wimplicit-fallthrough" "$fallthrough" | |
2372 | ||
ff547caa KB |
2373 | ########################################## |
2374 | # check for MADV_HUGEPAGE support | |
2375 | if test "$thp" != "yes" ; then | |
2376 | thp="no" | |
2377 | fi | |
2378 | if test "$esx" != "yes" ; then | |
2379 | cat > $TMPC <<EOF | |
2380 | #include <sys/mman.h> | |
2381 | int main(void) | |
2382 | { | |
2383 | return madvise(0, 0x1000, MADV_HUGEPAGE); | |
2384 | } | |
2385 | EOF | |
2386 | if compile_prog "" "" "thp" ; then | |
2387 | thp=yes | |
2388 | else | |
2389 | if test "$thp" = "yes" ; then | |
2390 | feature_not_found "Transparent Huge Page" "" | |
2391 | fi | |
2392 | thp=no | |
2393 | fi | |
2394 | fi | |
2395 | print_config "MADV_HUGEPAGE" "$thp" | |
2396 | ||
de5ed0e4 JA |
2397 | ########################################## |
2398 | # check for gettid() | |
2399 | gettid="no" | |
2400 | cat > $TMPC << EOF | |
2401 | #include <unistd.h> | |
2402 | int main(int argc, char **argv) | |
2403 | { | |
2404 | return gettid(); | |
2405 | } | |
2406 | EOF | |
2407 | if compile_prog "" "" "gettid"; then | |
2408 | gettid="yes" | |
2409 | fi | |
2410 | print_config "gettid" "$gettid" | |
2411 | ||
67bf9823 JA |
2412 | ############################################################################# |
2413 | ||
67bf9823 | 2414 | if test "$wordsize" = "64" ; then |
4feafb1e | 2415 | output_sym "CONFIG_64BIT" |
67bf9823 | 2416 | elif test "$wordsize" = "32" ; then |
4feafb1e | 2417 | output_sym "CONFIG_32BIT" |
67bf9823 | 2418 | else |
d7145a78 | 2419 | fatal "Unknown wordsize!" |
67bf9823 | 2420 | fi |
0dcebdf4 | 2421 | if test "$bigendian" = "yes" ; then |
4feafb1e | 2422 | output_sym "CONFIG_BIG_ENDIAN" |
0dcebdf4 | 2423 | else |
4feafb1e | 2424 | output_sym "CONFIG_LITTLE_ENDIAN" |
0dcebdf4 | 2425 | fi |
3989b143 JA |
2426 | if test "$zlib" = "yes" ; then |
2427 | output_sym "CONFIG_ZLIB" | |
2428 | fi | |
67bf9823 | 2429 | if test "$libaio" = "yes" ; then |
4feafb1e | 2430 | output_sym "CONFIG_LIBAIO" |
67bf9823 JA |
2431 | fi |
2432 | if test "$posix_aio" = "yes" ; then | |
4feafb1e | 2433 | output_sym "CONFIG_POSIXAIO" |
67bf9823 JA |
2434 | fi |
2435 | if test "$posix_aio_fsync" = "yes" ; then | |
4feafb1e | 2436 | output_sym "CONFIG_POSIXAIO_FSYNC" |
67bf9823 | 2437 | fi |
06eac6b2 SW |
2438 | if test "$posix_pshared" = "yes" ; then |
2439 | output_sym "CONFIG_PSHARED" | |
2440 | fi | |
44e8e956 | 2441 | if test "$have_asprintf" = "yes" ; then |
cb3b6806 | 2442 | output_sym "CONFIG_HAVE_ASPRINTF" |
44e8e956 BVA |
2443 | fi |
2444 | if test "$have_vasprintf" = "yes" ; then | |
cb3b6806 | 2445 | output_sym "CONFIG_HAVE_VASPRINTF" |
44e8e956 | 2446 | fi |
67bf9823 | 2447 | if test "$linux_fallocate" = "yes" ; then |
4feafb1e | 2448 | output_sym "CONFIG_LINUX_FALLOCATE" |
67bf9823 JA |
2449 | fi |
2450 | if test "$posix_fallocate" = "yes" ; then | |
4feafb1e | 2451 | output_sym "CONFIG_POSIX_FALLOCATE" |
67bf9823 JA |
2452 | fi |
2453 | if test "$fdatasync" = "yes" ; then | |
4feafb1e | 2454 | output_sym "CONFIG_FDATASYNC" |
67bf9823 JA |
2455 | fi |
2456 | if test "$sync_file_range" = "yes" ; then | |
4feafb1e | 2457 | output_sym "CONFIG_SYNC_FILE_RANGE" |
67bf9823 JA |
2458 | fi |
2459 | if test "$sfaa" = "yes" ; then | |
4feafb1e | 2460 | output_sym "CONFIG_SFAA" |
67bf9823 | 2461 | fi |
a250edd0 JA |
2462 | if test "$sync_sync" = "yes" ; then |
2463 | output_sym "CONFIG_SYNC_SYNC" | |
2464 | fi | |
2465 | if test "$cmp_swap" = "yes" ; then | |
2466 | output_sym "CONFIG_CMP_SWAP" | |
2467 | fi | |
954cd73a | 2468 | if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then |
4feafb1e | 2469 | output_sym "CONFIG_RDMA" |
67bf9823 JA |
2470 | fi |
2471 | if test "$clock_gettime" = "yes" ; then | |
4feafb1e | 2472 | output_sym "CONFIG_CLOCK_GETTIME" |
67bf9823 JA |
2473 | fi |
2474 | if test "$clock_monotonic" = "yes" ; then | |
4feafb1e | 2475 | output_sym "CONFIG_CLOCK_MONOTONIC" |
67bf9823 | 2476 | fi |
c544f604 SN |
2477 | if test "$clock_monotonic_raw" = "yes" ; then |
2478 | output_sym "CONFIG_CLOCK_MONOTONIC_RAW" | |
2479 | fi | |
67bf9823 | 2480 | if test "$clock_monotonic_precise" = "yes" ; then |
4feafb1e | 2481 | output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE" |
67bf9823 | 2482 | fi |
25f8227d JA |
2483 | if test "$clockid_t" = "yes"; then |
2484 | output_sym "CONFIG_CLOCKID_T" | |
2485 | fi | |
67bf9823 | 2486 | if test "$gettimeofday" = "yes" ; then |
4feafb1e | 2487 | output_sym "CONFIG_GETTIMEOFDAY" |
67bf9823 JA |
2488 | fi |
2489 | if test "$posix_fadvise" = "yes" ; then | |
4feafb1e | 2490 | output_sym "CONFIG_POSIX_FADVISE" |
67bf9823 JA |
2491 | fi |
2492 | if test "$linux_3arg_affinity" = "yes" ; then | |
4feafb1e | 2493 | output_sym "CONFIG_3ARG_AFFINITY" |
67bf9823 | 2494 | elif test "$linux_2arg_affinity" = "yes" ; then |
4feafb1e | 2495 | output_sym "CONFIG_2ARG_AFFINITY" |
67bf9823 JA |
2496 | fi |
2497 | if test "$strsep" = "yes" ; then | |
4feafb1e | 2498 | output_sym "CONFIG_STRSEP" |
67bf9823 | 2499 | fi |
9ad8da82 JA |
2500 | if test "$strcasestr" = "yes" ; then |
2501 | output_sym "CONFIG_STRCASESTR" | |
2502 | fi | |
5ad7be56 KD |
2503 | if test "$strlcat" = "yes" ; then |
2504 | output_sym "CONFIG_STRLCAT" | |
2505 | fi | |
67bf9823 | 2506 | if test "$getopt_long_only" = "yes" ; then |
4feafb1e | 2507 | output_sym "CONFIG_GETOPT_LONG_ONLY" |
67bf9823 JA |
2508 | fi |
2509 | if test "$inet_aton" = "yes" ; then | |
4feafb1e | 2510 | output_sym "CONFIG_INET_ATON" |
67bf9823 JA |
2511 | fi |
2512 | if test "$socklen_t" = "yes" ; then | |
4feafb1e | 2513 | output_sym "CONFIG_SOCKLEN_T" |
67bf9823 JA |
2514 | fi |
2515 | if test "$ext4_me" = "yes" ; then | |
4feafb1e | 2516 | output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT" |
67bf9823 JA |
2517 | fi |
2518 | if test "$linux_splice" = "yes" ; then | |
4feafb1e | 2519 | output_sym "CONFIG_LINUX_SPLICE" |
67bf9823 JA |
2520 | fi |
2521 | if test "$guasi" = "yes" ; then | |
4feafb1e | 2522 | output_sym "CONFIG_GUASI" |
67bf9823 | 2523 | fi |
50206d9b | 2524 | if test "$libnuma_v2" = "yes" ; then |
4feafb1e | 2525 | output_sym "CONFIG_LIBNUMA" |
67bf9823 JA |
2526 | fi |
2527 | if test "$solaris_aio" = "yes" ; then | |
4feafb1e | 2528 | output_sym "CONFIG_SOLARISAIO" |
67bf9823 JA |
2529 | fi |
2530 | if test "$tls_thread" = "yes" ; then | |
4feafb1e | 2531 | output_sym "CONFIG_TLS_THREAD" |
67bf9823 | 2532 | fi |
44404c5a | 2533 | if test "$rusage_thread" = "yes" ; then |
4feafb1e | 2534 | output_sym "CONFIG_RUSAGE_THREAD" |
67bf9823 | 2535 | fi |
91f94d5b | 2536 | if test "$gfio" = "yes" ; then |
bad7e42c | 2537 | output_sym "CONFIG_GFIO" |
91f94d5b | 2538 | fi |
c8931876 JA |
2539 | if test "$esx" = "yes" ; then |
2540 | output_sym "CONFIG_ESX" | |
2541 | output_sym "CONFIG_NO_SHM" | |
2542 | fi | |
7e09a9f1 JA |
2543 | if test "$sched_idle" = "yes" ; then |
2544 | output_sym "CONFIG_SCHED_IDLE" | |
2545 | fi | |
1eafa37a JA |
2546 | if test "$tcp_nodelay" = "yes" ; then |
2547 | output_sym "CONFIG_TCP_NODELAY" | |
2548 | fi | |
1008602c JA |
2549 | if test "$window_size" = "yes" ; then |
2550 | output_sym "CONFIG_NET_WINDOWSIZE" | |
2551 | fi | |
e5f34d95 JA |
2552 | if test "$mss" = "yes" ; then |
2553 | output_sym "CONFIG_NET_MSS" | |
2554 | fi | |
38b9354a JA |
2555 | if test "$rlimit_memlock" = "yes" ; then |
2556 | output_sym "CONFIG_RLIMIT_MEMLOCK" | |
2557 | fi | |
07fc0acd JA |
2558 | if test "$pwritev" = "yes" ; then |
2559 | output_sym "CONFIG_PWRITEV" | |
2560 | fi | |
2cafffbe JA |
2561 | if test "$pwritev2" = "yes" ; then |
2562 | output_sym "CONFIG_PWRITEV2" | |
2563 | fi | |
ecad55e9 JA |
2564 | if test "$ipv6" = "yes" ; then |
2565 | output_sym "CONFIG_IPV6" | |
2566 | fi | |
c2f6a13d LMB |
2567 | if test "$http" = "yes" ; then |
2568 | output_sym "CONFIG_HTTP" | |
2569 | fi | |
d5f9b0ea IF |
2570 | if test "$rados" = "yes" ; then |
2571 | output_sym "CONFIG_RADOS" | |
2572 | fi | |
fc5c0345 DG |
2573 | if test "$rbd" = "yes" ; then |
2574 | output_sym "CONFIG_RBD" | |
2575 | fi | |
53b6c979 PL |
2576 | if test "$rbd_poll" = "yes" ; then |
2577 | output_sym "CONFIG_RBD_POLL" | |
2578 | fi | |
903b2812 JA |
2579 | if test "$rbd_inval" = "yes" ; then |
2580 | output_sym "CONFIG_RBD_INVAL" | |
2581 | fi | |
2e802282 JA |
2582 | if test "$setvbuf" = "yes" ; then |
2583 | output_sym "CONFIG_SETVBUF" | |
2584 | fi | |
81795ce3 CE |
2585 | if test "$s390_z196_facilities" = "yes" ; then |
2586 | output_sym "CONFIG_S390_Z196_FACILITIES" | |
2587 | CFLAGS="$CFLAGS -march=z9-109" | |
9f75af77 | 2588 | march_set="yes" |
81795ce3 | 2589 | fi |
6e7d7dfb | 2590 | if test "$gfapi" = "yes" ; then |
2591 | output_sym "CONFIG_GFAPI" | |
2592 | fi | |
6fa14b99 | 2593 | if test "$gf_fadvise" = "yes" ; then |
2594 | output_sym "CONFIG_GF_FADVISE" | |
2595 | fi | |
6876c98c JA |
2596 | if test "$gf_trim" = "yes" ; then |
2597 | output_sym "CONFIG_GF_TRIM" | |
2598 | fi | |
ce4d13ca JA |
2599 | if test "$gf_new" = "yes" ; then |
2600 | output_sym "CONFIG_GF_NEW_API" | |
2601 | fi | |
1b10477b MM |
2602 | if test "$libhdfs" = "yes" ; then |
2603 | output_sym "CONFIG_LIBHDFS" | |
247e5436 | 2604 | echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak |
1527dc50 FB |
2605 | echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak |
2606 | echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak | |
2607 | echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak | |
247ef2aa | 2608 | fi |
b8116a87 DE |
2609 | if test "$mtd" = "yes" ; then |
2610 | output_sym "CONFIG_MTD" | |
2611 | fi | |
43f3cec2 BB |
2612 | if test "$pmemblk" = "yes" ; then |
2613 | output_sym "CONFIG_PMEMBLK" | |
2614 | fi | |
cbb15e42 DJ |
2615 | if test "$devdax" = "yes" ; then |
2616 | output_sym "CONFIG_LINUX_DEVDAX" | |
2617 | fi | |
ae0db592 TI |
2618 | if test "$pmem" = "yes" ; then |
2619 | output_sym "CONFIG_LIBPMEM" | |
2620 | fi | |
a40e7a59 GB |
2621 | if test "$libime" = "yes" ; then |
2622 | output_sym "CONFIG_IME" | |
2623 | fi | |
b470a02c SC |
2624 | if test "$arith" = "yes" ; then |
2625 | output_sym "CONFIG_ARITHMETIC" | |
e7b2c7a3 JA |
2626 | if test "$yacc_is_bison" = "yes" ; then |
2627 | echo "YACC=$YACC -y" >> $config_host_mak | |
2628 | else | |
2629 | echo "YACC=$YACC" >> $config_host_mak | |
2630 | fi | |
63bda378 JA |
2631 | if test "$lex_use_o" = "yes" ; then |
2632 | echo "CONFIG_LEX_USE_O=y" >> $config_host_mak | |
2633 | fi | |
b470a02c | 2634 | fi |
aae599ba JA |
2635 | if test "$getmntent" = "yes" ; then |
2636 | output_sym "CONFIG_GETMNTENT" | |
2637 | fi | |
e7e136da TK |
2638 | if test "$getmntinfo" = "yes" ; then |
2639 | output_sym "CONFIG_GETMNTINFO" | |
2640 | fi | |
b765bec0 TK |
2641 | if test "$getmntinfo_statvfs" = "yes" ; then |
2642 | output_sym "CONFIG_GETMNTINFO_STATVFS" | |
2643 | fi | |
5018f79f AH |
2644 | if test "$static_assert" = "yes" ; then |
2645 | output_sym "CONFIG_STATIC_ASSERT" | |
2646 | fi | |
e39c0676 JA |
2647 | if test "$have_bool" = "yes" ; then |
2648 | output_sym "CONFIG_HAVE_BOOL" | |
2649 | fi | |
b29c71c4 JA |
2650 | if test "$strndup" = "yes" ; then |
2651 | output_sym "CONFIG_HAVE_STRNDUP" | |
2652 | fi | |
484817a9 JA |
2653 | if test "$disable_opt" = "yes" ; then |
2654 | output_sym "CONFIG_DISABLE_OPTIMIZATIONS" | |
2655 | fi | |
0ffccc21 BVA |
2656 | if test "$valgrind_dev" = "yes"; then |
2657 | output_sym "CONFIG_VALGRIND_DEV" | |
2658 | fi | |
a76e1995 BVA |
2659 | if test "$linux_blkzoned" = "yes" ; then |
2660 | output_sym "CONFIG_LINUX_BLKZONED" | |
2661 | fi | |
605cf82e | 2662 | if test "$zlib" = "no" ; then |
8f909424 JA |
2663 | echo "Consider installing zlib-dev (zlib-devel, some fio features depend on it." |
2664 | if test "$build_static" = "yes"; then | |
2665 | echo "Note that some distros have separate packages for static libraries." | |
2666 | fi | |
605cf82e | 2667 | fi |
58828d07 SW |
2668 | if test "$march_armv8_a_crc_crypto" = "yes" ; then |
2669 | output_sym "ARCH_HAVE_CRC_CRYPTO" | |
2670 | fi | |
03553853 YR |
2671 | if test "$cuda" = "yes" ; then |
2672 | output_sym "CONFIG_CUDA" | |
2673 | fi | |
4252396e JA |
2674 | if test "$mkdir_two" = "yes" ; then |
2675 | output_sym "CONFIG_HAVE_MKDIR_TWO" | |
2676 | fi | |
9f75af77 | 2677 | if test "$march_set" = "no" && test "$build_native" = "yes" ; then |
a817dc3b JA |
2678 | output_sym "CONFIG_BUILD_NATIVE" |
2679 | fi | |
b8b0e1ee TK |
2680 | if test "$cunit" = "yes" ; then |
2681 | output_sym "CONFIG_HAVE_CUNIT" | |
2682 | fi | |
57fa61f0 JA |
2683 | if test "$__kernel_rwf_t" = "yes"; then |
2684 | output_sym "CONFIG_HAVE_KERNEL_RWF_T" | |
2685 | fi | |
de5ed0e4 JA |
2686 | if test "$gettid" = "yes"; then |
2687 | output_sym "CONFIG_HAVE_GETTID" | |
2688 | fi | |
71144e67 JA |
2689 | if test "$fallthrough" = "yes"; then |
2690 | CFLAGS="$CFLAGS -Wimplicit-fallthrough" | |
2691 | fi | |
ff547caa KB |
2692 | if test "$thp" = "yes" ; then |
2693 | output_sym "CONFIG_HAVE_THP" | |
2694 | fi | |
247ef2aa KZ |
2695 | if test "$libiscsi" = "yes" ; then |
2696 | output_sym "CONFIG_LIBISCSI" | |
2697 | echo "CONFIG_LIBISCSI=m" >> $config_host_mak | |
2698 | echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak | |
2699 | echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak | |
2700 | fi | |
01fe773d JD |
2701 | cat > $TMPC << EOF |
2702 | int main(int argc, char **argv) | |
2703 | { | |
2704 | return 0; | |
2705 | } | |
2706 | EOF | |
2707 | if test "$disable_tcmalloc" != "yes" && compile_prog "" "-ltcmalloc" "tcmalloc"; then | |
2708 | LIBS="-ltcmalloc $LIBS" | |
2709 | tcmalloc="yes" | |
2710 | else | |
2711 | tcmalloc="no" | |
2712 | fi | |
2713 | print_config "TCMalloc support" "$tcmalloc" | |
605cf82e | 2714 | |
67bf9823 | 2715 | echo "LIBS+=$LIBS" >> $config_host_mak |
86719845 | 2716 | echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak |
91f94d5b | 2717 | echo "CFLAGS+=$CFLAGS" >> $config_host_mak |
d2aeedb9 | 2718 | echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak |
67bf9823 | 2719 | echo "CC=$cc" >> $config_host_mak |
af4862b3 | 2720 | echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak |
020d54bd | 2721 | echo "INSTALL_PREFIX=$prefix" >> $config_host_mak |
c61a3a44 | 2722 | |
59d8f412 | 2723 | if [ `dirname $0` != "." -a ! -e Makefile ]; then |
c61a3a44 JF |
2724 | cat > Makefile <<EOF |
2725 | SRCDIR:=`dirname $0` | |
2726 | include \$(SRCDIR)/Makefile | |
2727 | EOF | |
2728 | fi |