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