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