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