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