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