Commit | Line | Data |
---|---|---|
67bf9823 JA |
1 | #!/bin/sh |
2 | # | |
3 | # Fio configure script. Heavily influenced by the manual qemu configure | |
4 | # script. Sad this this is easier than autoconf and enemies. | |
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" | |
17 | TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o" | |
18 | TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe" | |
19 | ||
20 | # NB: do not call "exit" in the trap handler; this is buggy with some shells; | |
21 | # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org> | |
22 | trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM | |
23 | ||
24 | rm -rf config.log | |
25 | ||
26 | config_host_mak="config-host.mak" | |
4feafb1e JA |
27 | config_host_h="config-host.h" |
28 | ||
29 | rm -rf $config_host_mak | |
30 | rm -rf $config_host_h | |
67bf9823 | 31 | |
d7145a78 JA |
32 | fatal() { |
33 | echo $@ | |
34 | echo "Configure failed, check config.log and/or the above output" | |
35 | rm -rf $config_host_mak | |
36 | rm -rf $config_host_h | |
37 | exit 1 | |
38 | } | |
39 | ||
44404c5a | 40 | # Default CFLAGS |
af4862b3 JA |
41 | CFLAGS="-D_GNU_SOURCE -include config-host.h" |
42 | BUILD_CFLAGS="" | |
67bf9823 JA |
43 | |
44 | # Print a helpful header at the top of config.log | |
45 | echo "# FIO configure log $(date)" >> config.log | |
46 | printf "# Configured with:" >> config.log | |
47 | printf " '%s'" "$0" "$@" >> config.log | |
48 | echo >> config.log | |
49 | echo "#" >> config.log | |
50 | ||
7560fe7c JA |
51 | # Print configure header at the top of $config_host_h |
52 | echo "/*" > $config_host_h | |
53 | echo " * Automatically generated by configure - do not modify" >> $config_host_h | |
54 | printf " * Configured with:" >> $config_host_h | |
55 | printf " * '%s'" "$0" "$@" >> $config_host_h | |
56 | echo "" >> $config_host_h | |
57 | echo " */" >> $config_host_h | |
58 | ||
67bf9823 JA |
59 | do_cc() { |
60 | # Run the compiler, capturing its output to the log. | |
61 | echo $cc "$@" >> config.log | |
62 | $cc "$@" >> config.log 2>&1 || return $? | |
63 | # Test passed. If this is an --enable-werror build, rerun | |
64 | # the test with -Werror and bail out if it fails. This | |
65 | # makes warning-generating-errors in configure test code | |
66 | # obvious to developers. | |
67 | if test "$werror" != "yes"; then | |
68 | return 0 | |
69 | fi | |
70 | # Don't bother rerunning the compile if we were already using -Werror | |
71 | case "$*" in | |
72 | *-Werror*) | |
73 | return 0 | |
74 | ;; | |
75 | esac | |
76 | echo $cc -Werror "$@" >> config.log | |
77 | $cc -Werror "$@" >> config.log 2>&1 && return $? | |
78 | echo "ERROR: configure test passed without -Werror but failed with -Werror." | |
79 | echo "This is probably a bug in the configure script. The failing command" | |
80 | echo "will be at the bottom of config.log." | |
d7145a78 | 81 | fatal "You can run configure with --disable-werror to bypass this check." |
67bf9823 JA |
82 | } |
83 | ||
84 | compile_object() { | |
85 | do_cc $CFLAGS -c -o $TMPO $TMPC | |
86 | } | |
87 | ||
88 | compile_prog() { | |
89 | local_cflags="$1" | |
adaa46d8 | 90 | local_ldflags="$2 $LIBS" |
67bf9823 JA |
91 | echo "Compiling test case $3" >> config.log |
92 | do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags | |
93 | } | |
94 | ||
95 | feature_not_found() { | |
96 | feature=$1 | |
c55d728b | 97 | packages=$2 |
67bf9823 JA |
98 | |
99 | echo "ERROR" | |
100 | echo "ERROR: User requested feature $feature" | |
c55d728b JA |
101 | if test ! -z "$packages" ; then |
102 | echo "ERROR: That feature needs $packages installed" | |
103 | fi | |
67bf9823 | 104 | echo "ERROR: configure was not able to find it" |
d7145a78 | 105 | fatal "ERROR" |
67bf9823 JA |
106 | } |
107 | ||
108 | has() { | |
109 | type "$1" >/dev/null 2>&1 | |
110 | } | |
111 | ||
112 | check_define() { | |
113 | cat > $TMPC <<EOF | |
114 | #if !defined($1) | |
115 | #error $1 not defined | |
116 | #endif | |
117 | int main(void) | |
118 | { | |
119 | return 0; | |
120 | } | |
121 | EOF | |
122 | compile_object | |
123 | } | |
124 | ||
4feafb1e JA |
125 | output_sym() { |
126 | echo "$1=y" >> $config_host_mak | |
127 | echo "#define $1" >> $config_host_h | |
128 | } | |
129 | ||
67bf9823 JA |
130 | targetos="" |
131 | cpu="" | |
132 | ||
91f94d5b | 133 | # default options |
47f44635 JA |
134 | show_help="no" |
135 | exit_val=0 | |
ebec2094 | 136 | gfio_check="no" |
1b10477b | 137 | libhdfs="no" |
020d54bd | 138 | prefix=/usr/local |
91f94d5b | 139 | |
cb1125b0 JA |
140 | # parse options |
141 | for opt do | |
142 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` | |
143 | case "$opt" in | |
020d54bd JA |
144 | --prefix=*) prefix="$optarg" |
145 | ;; | |
8b156d8e JA |
146 | --cpu=*) cpu="$optarg" |
147 | ;; | |
c8931876 JA |
148 | # esx is cross compiled and cannot be detect through simple uname calls |
149 | --esx) | |
150 | esx="yes" | |
151 | ;; | |
cb1125b0 JA |
152 | --cc=*) CC="$optarg" |
153 | ;; | |
208e4c8b JA |
154 | --extra-cflags=*) CFLAGS="$CFLAGS $optarg" |
155 | ;; | |
b7c12794 | 156 | --build-32bit-win) build_32bit_win="yes" |
7409711b | 157 | ;; |
d2aeedb9 JA |
158 | --build-static) build_static="yes" |
159 | ;; | |
91f94d5b | 160 | --enable-gfio) |
ebec2094 | 161 | gfio_check="yes" |
899fab33 | 162 | ;; |
44462517 CF |
163 | --disable-numa) disable_numa="yes" |
164 | ;; | |
ce18290e TM |
165 | --disable-rbd) disable_rbd="yes" |
166 | ;; | |
167 | --disable-gfapi) disable_gfapi="yes" | |
168 | ;; | |
1b10477b MM |
169 | --enable-libhdfs) libhdfs="yes" |
170 | ;; | |
ba40757e JA |
171 | --disable-shm) output_sym "CONFIG_NO_SHM" |
172 | ;; | |
827da4f5 | 173 | --help) |
47f44635 | 174 | show_help="yes" |
827da4f5 | 175 | ;; |
cb1125b0 JA |
176 | *) |
177 | echo "Bad option $opt" | |
47f44635 JA |
178 | show_help="yes" |
179 | exit_val=1 | |
cb1125b0 JA |
180 | esac |
181 | done | |
182 | ||
47f44635 | 183 | if test "$show_help" = "yes" ; then |
020d54bd | 184 | echo "--prefix= Use this directory as installation prefix" |
8b156d8e | 185 | echo "--cpu= Specify target CPU if auto-detect fails" |
b7a99316 | 186 | echo "--cc= Specify compiler to use" |
899fab33 | 187 | echo "--extra-cflags= Specify extra CFLAGS to pass to compiler" |
b7c12794 | 188 | echo "--build-32bit-win Enable 32-bit build on Windows" |
d2aeedb9 | 189 | echo "--build-static Build a static fio" |
c8931876 | 190 | echo "--esx Configure build options for esx" |
b7a99316 | 191 | echo "--enable-gfio Enable building of gtk gfio" |
44462517 | 192 | echo "--disable-numa Disable libnuma even if found" |
c44ff511 | 193 | echo "--disable-gfapi Disable gfapi" |
1b10477b | 194 | echo "--enable-libhdfs Enable hdfs support" |
c44ff511 | 195 | echo "--disable-shm Disable SHM support" |
b7a99316 | 196 | exit $exit_val |
47f44635 JA |
197 | fi |
198 | ||
47986339 SH |
199 | cross_prefix=${cross_prefix-${CROSS_COMPILE}} |
200 | cc="${CC-${cross_prefix}gcc}" | |
201 | ||
6d0e9f83 AC |
202 | if check_define __ANDROID__ ; then |
203 | targetos="Android" | |
204 | elif check_define __linux__ ; then | |
67bf9823 | 205 | targetos="Linux" |
67bf9823 JA |
206 | elif check_define __OpenBSD__ ; then |
207 | targetos='OpenBSD' | |
208 | elif check_define __sun__ ; then | |
209 | targetos='SunOS' | |
7cb024f8 | 210 | CFLAGS="$CFLAGS -D_REENTRANT" |
b24f59ab SH |
211 | elif check_define _WIN32 ; then |
212 | targetos='CYGWIN' | |
67bf9823 JA |
213 | else |
214 | targetos=`uname -s` | |
215 | fi | |
216 | ||
53cd4eee AC |
217 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
218 | printf "# Configured with:" >> $config_host_mak | |
219 | printf " '%s'" "$0" "$@" >> $config_host_mak | |
220 | echo >> $config_host_mak | |
221 | echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak | |
222 | ||
67bf9823 JA |
223 | # Some host OSes need non-standard checks for which CPU to use. |
224 | # Note that these checks are broken for cross-compilation: if you're | |
225 | # cross-compiling to one of these OSes then you'll need to specify | |
226 | # the correct CPU with the --cpu option. | |
227 | case $targetos in | |
228 | Darwin) | |
229 | # on Leopard most of the system is 32-bit, so we have to ask the kernel if | |
230 | # we can run 64-bit userspace code. | |
231 | # If the user didn't specify a CPU explicitly and the kernel says this is | |
232 | # 64 bit hw, then assume x86_64. Otherwise fall through to the usual | |
233 | # detection code. | |
234 | if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then | |
235 | cpu="x86_64" | |
236 | fi | |
237 | ;; | |
238 | SunOS) | |
239 | # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo | |
240 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then | |
241 | cpu="x86_64" | |
242 | fi | |
adaa46d8 | 243 | LIBS="-lnsl -lsocket" |
cfd94f79 JA |
244 | ;; |
245 | CYGWIN*) | |
246 | echo "Forcing known good options on Windows" | |
4578d01f | 247 | if test -z "$CC" ; then |
7409711b HL |
248 | if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then |
249 | CC="i686-w64-mingw32-gcc" | |
250 | else | |
251 | CC="x86_64-w64-mingw32-gcc" | |
252 | fi | |
4578d01f | 253 | fi |
4feafb1e | 254 | output_sym "CONFIG_LITTLE_ENDIAN" |
7409711b HL |
255 | if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then |
256 | output_sym "CONFIG_32BIT" | |
257 | else | |
258 | output_sym "CONFIG_64BIT_LLP64" | |
259 | fi | |
4feafb1e JA |
260 | output_sym "CONFIG_FADVISE" |
261 | output_sym "CONFIG_SOCKLEN_T" | |
4feafb1e JA |
262 | output_sym "CONFIG_FADVISE" |
263 | output_sym "CONFIG_SFAA" | |
264 | output_sym "CONFIG_RUSAGE_THREAD" | |
265 | output_sym "CONFIG_WINDOWSAIO" | |
266 | output_sym "CONFIG_FDATASYNC" | |
59308a64 | 267 | output_sym "CONFIG_CLOCK_MONOTONIC" |
dc0518ca BC |
268 | output_sym "CONFIG_GETTIMEOFDAY" |
269 | output_sym "CONFIG_CLOCK_GETTIME" | |
7e09a9f1 | 270 | output_sym "CONFIG_SCHED_IDLE" |
1eafa37a | 271 | output_sym "CONFIG_TCP_NODELAY" |
7d6be13a | 272 | output_sym "CONFIG_TLS_THREAD" |
ef07baa1 | 273 | output_sym "CONFIG_IPV6" |
4feafb1e | 274 | echo "CC=$CC" >> $config_host_mak |
af4862b3 | 275 | echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak |
cfd94f79 | 276 | exit 0 |
6d0e9f83 | 277 | ;; |
67bf9823 JA |
278 | esac |
279 | ||
280 | if test ! -z "$cpu" ; then | |
281 | # command line argument | |
282 | : | |
283 | elif check_define __i386__ ; then | |
284 | cpu="i386" | |
285 | elif check_define __x86_64__ ; then | |
286 | cpu="x86_64" | |
287 | elif check_define __sparc__ ; then | |
288 | if check_define __arch64__ ; then | |
289 | cpu="sparc64" | |
290 | else | |
291 | cpu="sparc" | |
292 | fi | |
293 | elif check_define _ARCH_PPC ; then | |
294 | if check_define _ARCH_PPC64 ; then | |
295 | cpu="ppc64" | |
296 | else | |
297 | cpu="ppc" | |
298 | fi | |
299 | elif check_define __mips__ ; then | |
300 | cpu="mips" | |
301 | elif check_define __ia64__ ; then | |
302 | cpu="ia64" | |
303 | elif check_define __s390__ ; then | |
304 | if check_define __s390x__ ; then | |
305 | cpu="s390x" | |
306 | else | |
307 | cpu="s390" | |
308 | fi | |
309 | elif check_define __arm__ ; then | |
310 | cpu="arm" | |
311 | elif check_define __hppa__ ; then | |
312 | cpu="hppa" | |
313 | else | |
314 | cpu=`uname -m` | |
315 | fi | |
316 | ||
317 | # Normalise host CPU name and set ARCH. | |
318 | case "$cpu" in | |
319 | ia64|ppc|ppc64|s390|s390x|sparc64) | |
320 | cpu="$cpu" | |
321 | ;; | |
322 | i386|i486|i586|i686|i86pc|BePC) | |
323 | cpu="i386" | |
324 | ;; | |
325 | x86_64|amd64) | |
326 | cpu="x86_64" | |
327 | ;; | |
328 | armv*b|armv*l|arm) | |
329 | cpu="arm" | |
330 | ;; | |
331 | hppa|parisc|parisc64) | |
332 | cpu="hppa" | |
333 | ;; | |
334 | mips*) | |
335 | cpu="mips" | |
336 | ;; | |
337 | sparc|sun4[cdmuv]) | |
338 | cpu="sparc" | |
339 | ;; | |
340 | *) | |
8b156d8e | 341 | echo "Unknown CPU" |
67bf9823 JA |
342 | ;; |
343 | esac | |
344 | ||
dcbbf5b0 | 345 | if test -z "$CC" ; then |
67bf9823 JA |
346 | if test "$targetos" = "FreeBSD"; then |
347 | if has clang; then | |
348 | CC=clang | |
349 | else | |
350 | CC=gcc | |
351 | fi | |
67bf9823 JA |
352 | fi |
353 | fi | |
354 | ||
355 | cc="${CC-${cross_prefix}gcc}" | |
356 | ||
1a17cfdb AC |
357 | ########################################## |
358 | # check cross compile | |
359 | ||
360 | cross_compile="no" | |
361 | cat > $TMPC <<EOF | |
362 | int main(void) | |
363 | { | |
364 | return 0; | |
365 | } | |
366 | EOF | |
367 | if compile_prog "" "" "cross"; then | |
368 | $TMPE 2>/dev/null || cross_compile="yes" | |
369 | else | |
370 | fatal "compile test failed" | |
371 | fi | |
372 | ||
0dcebdf4 JA |
373 | ########################################## |
374 | # check endianness | |
375 | bigendian="no" | |
1a17cfdb AC |
376 | if test "$cross_compile" = "no" ; then |
377 | cat > $TMPC <<EOF | |
0dcebdf4 JA |
378 | #include <inttypes.h> |
379 | int main(void) | |
380 | { | |
381 | volatile uint32_t i=0x01234567; | |
382 | return (*((uint8_t*)(&i))) == 0x67; | |
383 | } | |
384 | EOF | |
1a17cfdb AC |
385 | if compile_prog "" "" "endian"; then |
386 | $TMPE && bigendian="yes" | |
387 | fi | |
388 | else | |
389 | # If we're cross compiling, try our best to work it out and rely on the | |
390 | # run-time check to fail if we get it wrong. | |
391 | cat > $TMPC <<EOF | |
392 | #include <endian.h> | |
393 | int main(void) | |
394 | { | |
395 | #if __BYTE_ORDER != __BIG_ENDIAN | |
396 | # error "Unknown endianness" | |
397 | #endif | |
398 | } | |
399 | EOF | |
400 | compile_prog "" "" "endian" && bigendian="yes" | |
401 | check_define "__ARMEB__" && bigendian="yes" | |
402 | check_define "__MIPSEB__" && bigendian="yes" | |
0dcebdf4 JA |
403 | fi |
404 | ||
405 | ||
67bf9823 JA |
406 | echo "Operating system $targetos" |
407 | echo "CPU $cpu" | |
0dcebdf4 | 408 | echo "Big endian $bigendian" |
67bf9823 | 409 | echo "Compiler $cc" |
1a17cfdb | 410 | echo "Cross compile $cross_compile" |
67bf9823 JA |
411 | echo |
412 | ||
d2aeedb9 JA |
413 | ########################################## |
414 | # See if we need to build a static build | |
415 | if test "$build_static" = "yes" ; then | |
416 | CFLAGS="$CFLAGS -ffunction-sections -fdata-sections" | |
417 | LDFLAGS="$LDFLAGS -static -Wl,--gc-sections" | |
418 | else | |
419 | build_static="no" | |
420 | fi | |
421 | echo "Static build $build_static" | |
422 | ||
67bf9823 JA |
423 | ########################################## |
424 | # check for wordsize | |
425 | wordsize="0" | |
426 | cat > $TMPC <<EOF | |
142429e5 AC |
427 | #include <limits.h> |
428 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | |
67bf9823 JA |
429 | int main(void) |
430 | { | |
142429e5 | 431 | BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE); |
67bf9823 JA |
432 | return 0; |
433 | } | |
434 | EOF | |
142429e5 AC |
435 | if compile_prog "-DWORDSIZE=32" "" "wordsize"; then |
436 | wordsize="32" | |
437 | elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then | |
438 | wordsize="64" | |
439 | else | |
440 | fatal "Unknown wordsize" | |
67bf9823 JA |
441 | fi |
442 | echo "Wordsize $wordsize" | |
443 | ||
a9bca4aa JA |
444 | ########################################## |
445 | # zlib probe | |
446 | zlib="no" | |
447 | cat > $TMPC <<EOF | |
e0186b6f | 448 | #include <zlib.h> |
a9bca4aa JA |
449 | int main(void) |
450 | { | |
451 | z_stream stream; | |
452 | if (inflateInit(&stream) != Z_OK) | |
453 | return 1; | |
454 | return 0; | |
455 | } | |
456 | EOF | |
457 | if compile_prog "" "-lz" "zlib" ; then | |
458 | zlib=yes | |
459 | LIBS="-lz $LIBS" | |
a9bca4aa JA |
460 | fi |
461 | echo "zlib $zlib" | |
462 | ||
67bf9823 JA |
463 | ########################################## |
464 | # linux-aio probe | |
465 | libaio="no" | |
466 | cat > $TMPC <<EOF | |
467 | #include <libaio.h> | |
468 | #include <stddef.h> | |
469 | int main(void) | |
470 | { | |
471 | io_setup(0, NULL); | |
472 | return 0; | |
473 | } | |
474 | EOF | |
475 | if compile_prog "" "-laio" "libaio" ; then | |
476 | libaio=yes | |
477 | LIBS="-laio $LIBS" | |
478 | else | |
479 | if test "$libaio" = "yes" ; then | |
c55d728b | 480 | feature_not_found "linux AIO" "libaio-dev or libaio-devel" |
67bf9823 JA |
481 | fi |
482 | libaio=no | |
483 | fi | |
484 | echo "Linux AIO support $libaio" | |
485 | ||
486 | ########################################## | |
487 | # posix aio probe | |
488 | posix_aio="no" | |
489 | posix_aio_lrt="no" | |
490 | cat > $TMPC <<EOF | |
491 | #include <aio.h> | |
492 | int main(void) | |
493 | { | |
494 | struct aiocb cb; | |
495 | aio_read(&cb); | |
496 | return 0; | |
497 | } | |
498 | EOF | |
499 | if compile_prog "" "" "posixaio" ; then | |
500 | posix_aio="yes" | |
501 | elif compile_prog "" "-lrt" "posixaio"; then | |
502 | posix_aio="yes" | |
503 | posix_aio_lrt="yes" | |
504 | LIBS="-lrt $LIBS" | |
505 | fi | |
506 | echo "POSIX AIO support $posix_aio" | |
507 | echo "POSIX AIO support needs -lrt $posix_aio_lrt" | |
508 | ||
509 | ########################################## | |
510 | # posix aio fsync probe | |
511 | posix_aio_fsync="no" | |
512 | if test "$posix_aio" = "yes" ; then | |
513 | cat > $TMPC <<EOF | |
514 | #include <fcntl.h> | |
515 | #include <aio.h> | |
516 | int main(void) | |
517 | { | |
518 | struct aiocb cb; | |
519 | return aio_fsync(O_SYNC, &cb); | |
520 | return 0; | |
521 | } | |
522 | EOF | |
523 | if compile_prog "" "$LIBS" "posix_aio_fsync" ; then | |
524 | posix_aio_fsync=yes | |
525 | fi | |
526 | fi | |
527 | echo "POSIX AIO fsync $posix_aio_fsync" | |
528 | ||
529 | ########################################## | |
530 | # solaris aio probe | |
531 | solaris_aio="no" | |
532 | cat > $TMPC <<EOF | |
533 | #include <sys/types.h> | |
534 | #include <sys/asynch.h> | |
535 | #include <unistd.h> | |
536 | int main(void) | |
537 | { | |
538 | aio_result_t res; | |
539 | return aioread(0, NULL, 0, 0, SEEK_SET, &res); | |
540 | return 0; | |
541 | } | |
542 | EOF | |
543 | if compile_prog "" "-laio" "solarisaio" ; then | |
544 | solaris_aio=yes | |
545 | LIBS="-laio $LIBS" | |
546 | fi | |
547 | echo "Solaris AIO support $solaris_aio" | |
548 | ||
549 | ########################################## | |
f5cd2907 | 550 | # __sync_fetch_and_add test |
67bf9823 JA |
551 | sfaa="no" |
552 | cat > $TMPC << EOF | |
553 | static int sfaa(int *ptr) | |
554 | { | |
9c639a76 | 555 | return __sync_fetch_and_add(ptr, 0); |
67bf9823 JA |
556 | } |
557 | ||
558 | int main(int argc, char **argv) | |
559 | { | |
560 | int val = 42; | |
561 | sfaa(&val); | |
562 | return val; | |
563 | } | |
564 | EOF | |
565 | if compile_prog "" "" "__sync_fetch_and_add()" ; then | |
566 | sfaa="yes" | |
567 | fi | |
9c639a76 | 568 | echo "__sync_fetch_and_add $sfaa" |
67bf9823 JA |
569 | |
570 | ########################################## | |
571 | # libverbs probe | |
572 | libverbs="no" | |
573 | cat > $TMPC << EOF | |
574 | #include <stdio.h> | |
575 | #include <infiniband/arch.h> | |
576 | int main(int argc, char **argv) | |
577 | { | |
578 | struct ibv_pd *pd = ibv_alloc_pd(NULL); | |
579 | return 0; | |
580 | } | |
581 | EOF | |
582 | if compile_prog "" "-libverbs" "libverbs" ; then | |
583 | libverbs="yes" | |
584 | LIBS="-libverbs $LIBS" | |
585 | fi | |
586 | echo "libverbs $libverbs" | |
587 | ||
588 | ########################################## | |
589 | # rdmacm probe | |
590 | rdmacm="no" | |
591 | cat > $TMPC << EOF | |
592 | #include <stdio.h> | |
593 | #include <rdma/rdma_cma.h> | |
594 | int main(int argc, char **argv) | |
595 | { | |
596 | rdma_destroy_qp(NULL); | |
597 | return 0; | |
598 | } | |
599 | EOF | |
600 | if compile_prog "" "-lrdmacm" "rdma"; then | |
601 | rdmacm="yes" | |
602 | LIBS="-lrdmacm $LIBS" | |
603 | fi | |
604 | echo "rdmacm $rdmacm" | |
605 | ||
606 | ########################################## | |
607 | # Linux fallocate probe | |
608 | linux_fallocate="no" | |
609 | cat > $TMPC << EOF | |
610 | #include <stdio.h> | |
aa6738a5 | 611 | #include <fcntl.h> |
67bf9823 JA |
612 | #include <linux/falloc.h> |
613 | int main(int argc, char **argv) | |
614 | { | |
615 | int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024); | |
616 | return r; | |
617 | } | |
618 | EOF | |
619 | if compile_prog "" "" "linux_fallocate"; then | |
620 | linux_fallocate="yes" | |
621 | fi | |
622 | echo "Linux fallocate $linux_fallocate" | |
623 | ||
624 | ########################################## | |
625 | # POSIX fadvise probe | |
626 | posix_fadvise="no" | |
627 | cat > $TMPC << EOF | |
628 | #include <stdio.h> | |
629 | #include <fcntl.h> | |
630 | int main(int argc, char **argv) | |
631 | { | |
632 | int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL); | |
633 | return r; | |
634 | } | |
635 | EOF | |
636 | if compile_prog "" "" "posix_fadvise"; then | |
637 | posix_fadvise="yes" | |
638 | fi | |
639 | echo "POSIX fadvise $posix_fadvise" | |
640 | ||
641 | ########################################## | |
642 | # POSIX fallocate probe | |
643 | posix_fallocate="no" | |
644 | cat > $TMPC << EOF | |
645 | #include <stdio.h> | |
646 | #include <fcntl.h> | |
647 | int main(int argc, char **argv) | |
648 | { | |
649 | int r = posix_fallocate(0, 0, 1024); | |
650 | return r; | |
651 | } | |
652 | EOF | |
653 | if compile_prog "" "" "posix_fallocate"; then | |
654 | posix_fallocate="yes" | |
655 | fi | |
656 | echo "POSIX fallocate $posix_fallocate" | |
657 | ||
658 | ########################################## | |
659 | # sched_set/getaffinity 2 or 3 argument test | |
660 | linux_2arg_affinity="no" | |
661 | linux_3arg_affinity="no" | |
662 | cat > $TMPC << EOF | |
67bf9823 JA |
663 | #include <sched.h> |
664 | int main(int argc, char **argv) | |
665 | { | |
666 | cpu_set_t mask; | |
667 | return sched_setaffinity(0, sizeof(mask), &mask); | |
668 | } | |
669 | EOF | |
670 | if compile_prog "" "" "sched_setaffinity(,,)"; then | |
671 | linux_3arg_affinity="yes" | |
672 | else | |
673 | cat > $TMPC << EOF | |
67bf9823 JA |
674 | #include <sched.h> |
675 | int main(int argc, char **argv) | |
676 | { | |
677 | cpu_set_t mask; | |
678 | return sched_setaffinity(0, &mask); | |
679 | } | |
680 | EOF | |
681 | if compile_prog "" "" "sched_setaffinity(,)"; then | |
682 | linux_2arg_affinity="yes" | |
683 | fi | |
684 | fi | |
685 | echo "sched_setaffinity(3 arg) $linux_3arg_affinity" | |
686 | echo "sched_setaffinity(2 arg) $linux_2arg_affinity" | |
687 | ||
688 | ########################################## | |
689 | # clock_gettime probe | |
690 | clock_gettime="no" | |
691 | cat > $TMPC << EOF | |
692 | #include <stdio.h> | |
693 | #include <time.h> | |
694 | int main(int argc, char **argv) | |
695 | { | |
696 | return clock_gettime(0, NULL); | |
697 | } | |
698 | EOF | |
699 | if compile_prog "" "" "clock_gettime"; then | |
700 | clock_gettime="yes" | |
701 | elif compile_prog "" "-lrt" "clock_gettime"; then | |
702 | clock_gettime="yes" | |
703 | LIBS="-lrt $LIBS" | |
704 | fi | |
705 | echo "clock_gettime $clock_gettime" | |
706 | ||
707 | ########################################## | |
708 | # CLOCK_MONOTONIC probe | |
709 | clock_monotonic="no" | |
710 | if test "$clock_gettime" = "yes" ; then | |
711 | cat > $TMPC << EOF | |
712 | #include <stdio.h> | |
713 | #include <time.h> | |
714 | int main(int argc, char **argv) | |
715 | { | |
716 | return clock_gettime(CLOCK_MONOTONIC, NULL); | |
717 | } | |
718 | EOF | |
719 | if compile_prog "" "$LIBS" "clock monotonic"; then | |
720 | clock_monotonic="yes" | |
721 | fi | |
722 | fi | |
723 | echo "CLOCK_MONOTONIC $clock_monotonic" | |
724 | ||
c544f604 SN |
725 | ########################################## |
726 | # CLOCK_MONOTONIC_RAW probe | |
727 | clock_monotonic_raw="no" | |
728 | if test "$clock_gettime" = "yes" ; then | |
729 | cat > $TMPC << EOF | |
730 | #include <stdio.h> | |
731 | #include <time.h> | |
732 | int main(int argc, char **argv) | |
733 | { | |
734 | return clock_gettime(CLOCK_MONOTONIC_RAW, NULL); | |
735 | } | |
736 | EOF | |
737 | if compile_prog "" "$LIBS" "clock monotonic"; then | |
738 | clock_monotonic_raw="yes" | |
739 | fi | |
740 | fi | |
741 | echo "CLOCK_MONOTONIC_RAW $clock_monotonic_raw" | |
742 | ||
67bf9823 JA |
743 | ########################################## |
744 | # CLOCK_MONOTONIC_PRECISE probe | |
745 | clock_monotonic_precise="no" | |
746 | if test "$clock_gettime" = "yes" ; then | |
747 | cat > $TMPC << EOF | |
748 | #include <stdio.h> | |
749 | #include <time.h> | |
750 | int main(int argc, char **argv) | |
751 | { | |
752 | return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL); | |
753 | } | |
754 | EOF | |
755 | if compile_prog "" "$LIBS" "clock monotonic precise"; then | |
756 | clock_monotonic_precise="yes" | |
757 | fi | |
758 | fi | |
759 | echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise" | |
760 | ||
761 | ########################################## | |
762 | # gettimeofday() probe | |
763 | gettimeofday="no" | |
764 | cat > $TMPC << EOF | |
765 | #include <sys/time.h> | |
766 | #include <stdio.h> | |
767 | int main(int argc, char **argv) | |
768 | { | |
769 | struct timeval tv; | |
770 | return gettimeofday(&tv, NULL); | |
771 | } | |
772 | EOF | |
773 | if compile_prog "" "" "gettimeofday"; then | |
774 | gettimeofday="yes" | |
775 | fi | |
776 | echo "gettimeofday $gettimeofday" | |
777 | ||
778 | ########################################## | |
779 | # fdatasync() probe | |
780 | fdatasync="no" | |
781 | cat > $TMPC << EOF | |
782 | #include <stdio.h> | |
783 | #include <unistd.h> | |
784 | int main(int argc, char **argv) | |
785 | { | |
786 | return fdatasync(0); | |
787 | } | |
788 | EOF | |
789 | if compile_prog "" "" "fdatasync"; then | |
790 | fdatasync="yes" | |
791 | fi | |
792 | echo "fdatasync $fdatasync" | |
793 | ||
794 | ########################################## | |
795 | # sync_file_range() probe | |
796 | sync_file_range="no" | |
797 | cat > $TMPC << EOF | |
798 | #include <stdio.h> | |
799 | #include <unistd.h> | |
67bf9823 JA |
800 | #include <fcntl.h> |
801 | #include <linux/fs.h> | |
802 | int main(int argc, char **argv) | |
803 | { | |
804 | unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | | |
805 | SYNC_FILE_RANGE_WAIT_AFTER; | |
806 | return sync_file_range(0, 0, 0, flags); | |
807 | } | |
808 | EOF | |
809 | if compile_prog "" "" "sync_file_range"; then | |
810 | sync_file_range="yes" | |
811 | fi | |
812 | echo "sync_file_range $sync_file_range" | |
813 | ||
814 | ########################################## | |
815 | # ext4 move extent probe | |
816 | ext4_me="no" | |
817 | cat > $TMPC << EOF | |
818 | #include <fcntl.h> | |
819 | #include <sys/ioctl.h> | |
820 | int main(int argc, char **argv) | |
821 | { | |
822 | struct move_extent me; | |
823 | return ioctl(0, EXT4_IOC_MOVE_EXT, &me); | |
824 | } | |
825 | EOF | |
c7165b8d JA |
826 | if compile_prog "" "" "ext4 move extent" ; then |
827 | ext4_me="yes" | |
828 | elif test $targetos = "Linux" ; then | |
829 | # On Linux, just default to it on and let it error at runtime if we really | |
830 | # don't have it. None of my updated systems have it defined, but it does | |
831 | # work. Takes a while to bubble back. | |
67bf9823 JA |
832 | ext4_me="yes" |
833 | fi | |
834 | echo "EXT4 move extent $ext4_me" | |
835 | ||
836 | ########################################## | |
837 | # splice probe | |
838 | linux_splice="no" | |
839 | cat > $TMPC << EOF | |
67bf9823 JA |
840 | #include <stdio.h> |
841 | #include <fcntl.h> | |
842 | int main(int argc, char **argv) | |
843 | { | |
844 | return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK); | |
845 | } | |
846 | EOF | |
847 | if compile_prog "" "" "linux splice"; then | |
848 | linux_splice="yes" | |
849 | fi | |
850 | echo "Linux splice(2) $linux_splice" | |
851 | ||
852 | ########################################## | |
853 | # GUASI probe | |
854 | guasi="no" | |
855 | cat > $TMPC << EOF | |
856 | #include <guasi.h> | |
857 | #include <guasi_syscalls.h> | |
858 | int main(int argc, char **argv) | |
859 | { | |
860 | guasi_t ctx = guasi_create(0, 0, 0); | |
861 | return 0; | |
862 | } | |
863 | EOF | |
864 | if compile_prog "" "" "guasi"; then | |
865 | guasi="yes" | |
866 | fi | |
867 | echo "GUASI $guasi" | |
868 | ||
869 | ########################################## | |
870 | # fusion-aw probe | |
871 | fusion_aw="no" | |
872 | cat > $TMPC << EOF | |
b2c77c25 | 873 | #include <nvm/nvm_primitives.h> |
67bf9823 JA |
874 | int main(int argc, char **argv) |
875 | { | |
b2c77c25 SK |
876 | nvm_version_t ver_info; |
877 | nvm_handle_t handle; | |
878 | ||
879 | handle = nvm_get_handle(0, &ver_info); | |
880 | return nvm_atomic_write(handle, 0, 0, 0); | |
67bf9823 JA |
881 | } |
882 | EOF | |
92aef550 ARJ |
883 | if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then |
884 | LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS" | |
67bf9823 JA |
885 | fusion_aw="yes" |
886 | fi | |
887 | echo "Fusion-io atomic engine $fusion_aw" | |
888 | ||
889 | ########################################## | |
890 | # libnuma probe | |
891 | libnuma="no" | |
892 | cat > $TMPC << EOF | |
893 | #include <numa.h> | |
894 | int main(int argc, char **argv) | |
895 | { | |
896 | return numa_available(); | |
897 | } | |
898 | EOF | |
44462517 | 899 | if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then |
67bf9823 JA |
900 | libnuma="yes" |
901 | LIBS="-lnuma $LIBS" | |
902 | fi | |
903 | echo "libnuma $libnuma" | |
904 | ||
50206d9b JA |
905 | ########################################## |
906 | # libnuma 2.x version API | |
907 | if test "$libnuma" = "yes" ; then | |
908 | libnuma_v2="no" | |
909 | cat > $TMPC << EOF | |
910 | #include <numa.h> | |
911 | int main(int argc, char **argv) | |
912 | { | |
913 | struct bitmask *mask = numa_parse_nodestring(NULL); | |
61bde962 | 914 | return mask->size == 0; |
50206d9b JA |
915 | } |
916 | EOF | |
917 | if compile_prog "" "" "libnuma api"; then | |
918 | libnuma_v2="yes" | |
919 | fi | |
920 | echo "libnuma v2 $libnuma_v2" | |
921 | fi | |
922 | ||
67bf9823 JA |
923 | ########################################## |
924 | # strsep() probe | |
925 | strsep="no" | |
926 | cat > $TMPC << EOF | |
927 | #include <string.h> | |
928 | int main(int argc, char **argv) | |
929 | { | |
930 | strsep(NULL, NULL); | |
931 | return 0; | |
932 | } | |
933 | EOF | |
934 | if compile_prog "" "" "strsep"; then | |
935 | strsep="yes" | |
936 | fi | |
937 | echo "strsep $strsep" | |
938 | ||
9ad8da82 JA |
939 | ########################################## |
940 | # strcasestr() probe | |
941 | strcasestr="no" | |
942 | cat > $TMPC << EOF | |
943 | #include <string.h> | |
944 | int main(int argc, char **argv) | |
945 | { | |
aa6738a5 | 946 | return strcasestr(argv[0], argv[1]) != NULL; |
9ad8da82 JA |
947 | } |
948 | EOF | |
949 | if compile_prog "" "" "strcasestr"; then | |
950 | strcasestr="yes" | |
951 | fi | |
952 | echo "strcasestr $strcasestr" | |
953 | ||
67bf9823 JA |
954 | ########################################## |
955 | # getopt_long_only() probe | |
956 | getopt_long_only="no" | |
957 | cat > $TMPC << EOF | |
958 | #include <unistd.h> | |
959 | #include <stdio.h> | |
aa6738a5 | 960 | #include <getopt.h> |
67bf9823 JA |
961 | int main(int argc, char **argv) |
962 | { | |
963 | int c = getopt_long_only(argc, argv, NULL, NULL, NULL); | |
964 | return c; | |
965 | } | |
966 | EOF | |
967 | if compile_prog "" "" "getopt_long_only"; then | |
968 | getopt_long_only="yes" | |
969 | fi | |
970 | echo "getopt_long_only() $getopt_long_only" | |
971 | ||
972 | ########################################## | |
973 | # inet_aton() probe | |
974 | inet_aton="no" | |
975 | cat > $TMPC << EOF | |
976 | #include <sys/socket.h> | |
977 | #include <arpa/inet.h> | |
978 | #include <stdio.h> | |
979 | int main(int argc, char **argv) | |
980 | { | |
981 | struct in_addr in; | |
982 | return inet_aton(NULL, &in); | |
983 | } | |
984 | EOF | |
985 | if compile_prog "" "" "inet_aton"; then | |
986 | inet_aton="yes" | |
987 | fi | |
988 | echo "inet_aton $inet_aton" | |
989 | ||
990 | ########################################## | |
991 | # socklen_t probe | |
992 | socklen_t="no" | |
993 | cat > $TMPC << EOF | |
f6482613 | 994 | #include <sys/socket.h> |
67bf9823 JA |
995 | int main(int argc, char **argv) |
996 | { | |
997 | socklen_t len = 0; | |
998 | return len; | |
999 | } | |
1000 | EOF | |
1001 | if compile_prog "" "" "socklen_t"; then | |
1002 | socklen_t="yes" | |
1003 | fi | |
1004 | echo "socklen_t $socklen_t" | |
1005 | ||
1006 | ########################################## | |
1007 | # Whether or not __thread is supported for TLS | |
1008 | tls_thread="no" | |
1009 | cat > $TMPC << EOF | |
1010 | #include <stdio.h> | |
aa6738a5 | 1011 | static __thread int ret; |
67bf9823 JA |
1012 | int main(int argc, char **argv) |
1013 | { | |
1014 | return ret; | |
1015 | } | |
1016 | EOF | |
1017 | if compile_prog "" "" "__thread"; then | |
1018 | tls_thread="yes" | |
1019 | fi | |
1020 | echo "__thread $tls_thread" | |
1021 | ||
91f94d5b | 1022 | ########################################## |
2639f056 | 1023 | # Check if we have required gtk/glib support for gfio |
ebec2094 JA |
1024 | gfio="no" |
1025 | if test "$gfio_check" = "yes" ; then | |
91f94d5b JA |
1026 | cat > $TMPC << EOF |
1027 | #include <glib.h> | |
1028 | #include <cairo.h> | |
1029 | #include <gtk/gtk.h> | |
1030 | int main(void) | |
1031 | { | |
1032 | gdk_threads_enter(); | |
91f94d5b | 1033 | gdk_threads_leave(); |
b7a99316 JA |
1034 | |
1035 | printf("%d", GTK_CHECK_VERSION(2, 18, 0)); | |
91f94d5b JA |
1036 | } |
1037 | EOF | |
1038 | GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0) | |
86719845 JA |
1039 | ORG_LDFLAGS=$LDFLAGS |
1040 | LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g) | |
91f94d5b JA |
1041 | if test "$?" != "0" ; then |
1042 | echo "configure: gtk and gthread not found" | |
1043 | exit 1 | |
1044 | fi | |
1045 | GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0) | |
1046 | if test "$?" != "0" ; then | |
1047 | echo "configure: gtk and gthread not found" | |
1048 | exit 1 | |
1049 | fi | |
b7a99316 JA |
1050 | if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then |
1051 | r=$($TMPE) | |
1052 | if test "$r" != "0" ; then | |
1053 | gfio="yes" | |
86719845 | 1054 | GFIO_LIBS="$LIBS $GTK_LIBS" |
b7a99316 JA |
1055 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
1056 | else | |
1057 | echo "GTK found, but need version 2.18 or higher" | |
1058 | gfio="no" | |
1059 | fi | |
91f94d5b JA |
1060 | else |
1061 | echo "Please install gtk and gdk libraries" | |
1062 | gfio="no" | |
1063 | fi | |
86719845 | 1064 | LDFLAGS=$ORG_LDFLAGS |
91f94d5b JA |
1065 | fi |
1066 | ||
ebec2094 JA |
1067 | if test "$gfio_check" = "yes" ; then |
1068 | echo "gtk 2.18 or higher $gfio" | |
1069 | fi | |
91f94d5b | 1070 | |
44404c5a JA |
1071 | # Check whether we have getrusage(RUSAGE_THREAD) |
1072 | rusage_thread="no" | |
1073 | cat > $TMPC << EOF | |
1074 | #include <sys/time.h> | |
1075 | #include <sys/resource.h> | |
1076 | int main(int argc, char **argv) | |
1077 | { | |
1078 | struct rusage ru; | |
1079 | getrusage(RUSAGE_THREAD, &ru); | |
1080 | return 0; | |
1081 | } | |
1082 | EOF | |
1083 | if compile_prog "" "" "RUSAGE_THREAD"; then | |
1084 | rusage_thread="yes" | |
1085 | fi | |
1086 | echo "RUSAGE_THREAD $rusage_thread" | |
1087 | ||
7e09a9f1 JA |
1088 | ########################################## |
1089 | # Check whether we have SCHED_IDLE | |
1090 | sched_idle="no" | |
1091 | cat > $TMPC << EOF | |
1092 | #include <sched.h> | |
1093 | int main(int argc, char **argv) | |
1094 | { | |
1095 | struct sched_param p; | |
1096 | return sched_setscheduler(0, SCHED_IDLE, &p); | |
1097 | } | |
1098 | EOF | |
1099 | if compile_prog "" "" "SCHED_IDLE"; then | |
1100 | sched_idle="yes" | |
1101 | fi | |
1102 | echo "SCHED_IDLE $sched_idle" | |
1103 | ||
1eafa37a JA |
1104 | ########################################## |
1105 | # Check whether we have TCP_NODELAY | |
1106 | tcp_nodelay="no" | |
1107 | cat > $TMPC << EOF | |
1108 | #include <stdio.h> | |
1109 | #include <sys/types.h> | |
1110 | #include <sys/socket.h> | |
1111 | #include <netinet/tcp.h> | |
1112 | int main(int argc, char **argv) | |
1113 | { | |
1114 | return getsockopt(0, 0, TCP_NODELAY, NULL, NULL); | |
1115 | } | |
1116 | EOF | |
1117 | if compile_prog "" "" "TCP_NODELAY"; then | |
1118 | tcp_nodelay="yes" | |
1119 | fi | |
1120 | echo "TCP_NODELAY $tcp_nodelay" | |
1121 | ||
1008602c JA |
1122 | ########################################## |
1123 | # Check whether we have SO_SNDBUF | |
1124 | window_size="no" | |
1125 | cat > $TMPC << EOF | |
1126 | #include <stdio.h> | |
1127 | #include <sys/types.h> | |
1128 | #include <sys/socket.h> | |
1129 | #include <netinet/tcp.h> | |
1130 | int main(int argc, char **argv) | |
1131 | { | |
1132 | setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0); | |
1133 | setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0); | |
1134 | } | |
1135 | EOF | |
1136 | if compile_prog "" "" "SO_SNDBUF"; then | |
1137 | window_size="yes" | |
1138 | fi | |
1139 | echo "Net engine window_size $window_size" | |
1140 | ||
e5f34d95 JA |
1141 | ########################################## |
1142 | # Check whether we have TCP_MAXSEG | |
1143 | mss="no" | |
1144 | cat > $TMPC << EOF | |
1145 | #include <stdio.h> | |
1146 | #include <sys/types.h> | |
1147 | #include <sys/socket.h> | |
1148 | #include <netinet/tcp.h> | |
1149 | #include <arpa/inet.h> | |
1150 | #include <netinet/in.h> | |
1151 | int main(int argc, char **argv) | |
1152 | { | |
1153 | return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0); | |
1154 | } | |
1155 | EOF | |
1156 | if compile_prog "" "" "TCP_MAXSEG"; then | |
1157 | mss="yes" | |
1158 | fi | |
1159 | echo "TCP_MAXSEG $mss" | |
1160 | ||
38b9354a JA |
1161 | ########################################## |
1162 | # Check whether we have RLIMIT_MEMLOCK | |
1163 | rlimit_memlock="no" | |
1164 | cat > $TMPC << EOF | |
1165 | #include <sys/time.h> | |
1166 | #include <sys/resource.h> | |
1167 | int main(int argc, char **argv) | |
1168 | { | |
1169 | struct rlimit rl; | |
1170 | return getrlimit(RLIMIT_MEMLOCK, &rl); | |
1171 | } | |
1172 | EOF | |
1173 | if compile_prog "" "" "RLIMIT_MEMLOCK"; then | |
1174 | rlimit_memlock="yes" | |
1175 | fi | |
1176 | echo "RLIMIT_MEMLOCK $rlimit_memlock" | |
1177 | ||
07fc0acd JA |
1178 | ########################################## |
1179 | # Check whether we have pwritev/preadv | |
1180 | pwritev="no" | |
1181 | cat > $TMPC << EOF | |
1182 | #include <stdio.h> | |
1183 | #include <sys/uio.h> | |
1184 | int main(int argc, char **argv) | |
1185 | { | |
1186 | return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0); | |
1187 | } | |
1188 | EOF | |
1189 | if compile_prog "" "" "pwritev"; then | |
1190 | pwritev="yes" | |
1191 | fi | |
1192 | echo "pwritev/preadv $pwritev" | |
1193 | ||
ecad55e9 JA |
1194 | ########################################## |
1195 | # Check whether we have the required functions for ipv6 | |
1196 | ipv6="no" | |
1197 | cat > $TMPC << EOF | |
1198 | #include <sys/types.h> | |
1199 | #include <sys/socket.h> | |
d219028d | 1200 | #include <netinet/in.h> |
ecad55e9 JA |
1201 | #include <netdb.h> |
1202 | #include <stdio.h> | |
1203 | int main(int argc, char **argv) | |
1204 | { | |
1205 | struct addrinfo hints; | |
1206 | struct in6_addr addr; | |
1207 | int ret; | |
1208 | ||
1209 | ret = getaddrinfo(NULL, NULL, &hints, NULL); | |
1210 | freeaddrinfo(NULL); | |
1211 | printf("%s\n", gai_strerror(ret)); | |
1212 | addr = in6addr_any; | |
1213 | return 0; | |
1214 | } | |
1215 | EOF | |
1216 | if compile_prog "" "" "ipv6"; then | |
1217 | ipv6="yes" | |
1218 | fi | |
1219 | echo "IPv6 helpers $ipv6" | |
07fc0acd | 1220 | |
fc5c0345 DG |
1221 | ########################################## |
1222 | # check for rbd | |
1223 | rbd="no" | |
1224 | cat > $TMPC << EOF | |
1225 | #include <rbd/librbd.h> | |
1226 | ||
1227 | int main(int argc, char **argv) | |
1228 | { | |
1229 | ||
1230 | rados_t cluster; | |
1231 | rados_ioctx_t io_ctx; | |
1232 | const char pool[] = "rbd"; | |
1233 | ||
1234 | int major, minor, extra; | |
1235 | rbd_version(&major, &minor, &extra); | |
1236 | ||
1237 | rados_ioctx_create(cluster, pool, &io_ctx); | |
1238 | return 0; | |
1239 | } | |
1240 | EOF | |
ce18290e | 1241 | if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then |
fc5c0345 DG |
1242 | LIBS="-lrbd -lrados $LIBS" |
1243 | rbd="yes" | |
1244 | fi | |
1245 | echo "Rados Block Device engine $rbd" | |
1246 | ||
903b2812 JA |
1247 | ########################################## |
1248 | # check for rbd_invaidate_cache() | |
1249 | rbd_inval="no" | |
1250 | if test "$rbd" = "yes"; then | |
1251 | cat > $TMPC << EOF | |
1252 | #include <rbd/librbd.h> | |
1253 | ||
1254 | int main(int argc, char **argv) | |
1255 | { | |
1256 | rbd_image_t image; | |
1257 | ||
1258 | return rbd_invalidate_cache(image); | |
1259 | } | |
1260 | EOF | |
1261 | if compile_prog "" "-lrbd -lrados" "rbd"; then | |
1262 | rbd_inval="yes" | |
1263 | fi | |
1264 | echo "rbd_invalidate_cache $rbd_inval" | |
1265 | fi | |
1266 | ||
2e802282 JA |
1267 | ########################################## |
1268 | # Check whether we have setvbuf | |
1269 | setvbuf="no" | |
1270 | cat > $TMPC << EOF | |
1271 | #include <stdio.h> | |
1272 | int main(int argc, char **argv) | |
1273 | { | |
1274 | FILE *f = NULL; | |
1275 | char buf[80]; | |
1276 | setvbuf(f, buf, _IOFBF, sizeof(buf)); | |
1277 | return 0; | |
1278 | } | |
1279 | EOF | |
1280 | if compile_prog "" "" "setvbuf"; then | |
1281 | setvbuf="yes" | |
1282 | fi | |
1283 | echo "setvbuf $setvbuf" | |
fc5c0345 | 1284 | |
6e7d7dfb | 1285 | # check for gfapi |
1286 | gfapi="no" | |
1287 | cat > $TMPC << EOF | |
1288 | #include <glusterfs/api/glfs.h> | |
1289 | ||
1290 | int main(int argc, char **argv) | |
1291 | { | |
1292 | ||
1293 | glfs_t *g = glfs_new("foo"); | |
1294 | ||
1295 | return 0; | |
1296 | } | |
1297 | EOF | |
ce18290e | 1298 | if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
6e7d7dfb | 1299 | LIBS="-lgfapi -lglusterfs $LIBS" |
1300 | gfapi="yes" | |
1301 | fi | |
6fa14b99 | 1302 | echo "Gluster API engine $gfapi" |
6e7d7dfb | 1303 | |
6fa14b99 | 1304 | ########################################## |
1305 | # check for gfapi fadvise support | |
6876c98c | 1306 | if test "$gfapi" = "yes" ; then |
6fa14b99 | 1307 | gf_fadvise="no" |
1308 | cat > $TMPC << EOF | |
1309 | #include <glusterfs/api/glfs.h> | |
1310 | ||
1311 | int main(int argc, char **argv) | |
1312 | { | |
1313 | struct glfs_fd *fd; | |
1314 | int ret = glfs_fadvise(fd, 0, 0, 1); | |
1315 | ||
1316 | return 0; | |
1317 | } | |
1318 | EOF | |
6fa14b99 | 1319 | if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then |
1320 | gf_fadvise="yes" | |
1321 | fi | |
1322 | echo "Gluster API use fadvise $gf_fadvise" | |
6876c98c JA |
1323 | fi |
1324 | ||
1325 | ########################################## | |
1326 | # check for gfapi trim support | |
1327 | gf_trim="no" | |
1328 | if test "$gfapi" = "yes" ; then | |
1329 | cat > $TMPC << EOF | |
1330 | #include <glusterfs/api/glfs.h> | |
1331 | ||
1332 | int main(int argc, char **argv) | |
1333 | { | |
1334 | return glfs_discard_async(NULL, 0, 0); | |
1335 | } | |
1336 | EOF | |
1337 | if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then | |
1338 | gf_trim="yes" | |
1339 | fi | |
1340 | echo "Gluster API trim support $gf_trim" | |
1341 | fi | |
fc5c0345 | 1342 | |
81795ce3 CE |
1343 | ########################################## |
1344 | # Check if we support stckf on s390 | |
1345 | s390_z196_facilities="no" | |
1346 | cat > $TMPC << EOF | |
1347 | #define STFLE_BITS_Z196 45 /* various z196 facilities ... */ | |
1348 | int main(int argc, char **argv) | |
1349 | { | |
1350 | /* We want just 1 double word to be returned. */ | |
1351 | register unsigned long reg0 asm("0") = 0; | |
1352 | unsigned long stfle_bits; | |
1353 | asm volatile(".machine push" "\n\t" | |
1354 | ".machine \"z9-109\"" "\n\t" | |
1355 | "stfle %0" "\n\t" | |
1356 | ".machine pop" "\n" | |
1357 | : "=QS" (stfle_bits), "+d" (reg0) | |
1358 | : : "cc"); | |
1359 | ||
1360 | if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0) | |
1361 | return 0; | |
1362 | else | |
1363 | return -1; | |
1364 | } | |
1365 | EOF | |
1366 | if compile_prog "" "" "s390_z196_facilities"; then | |
1367 | $TMPE | |
1368 | if [[ $? -eq 0 ]]; then | |
1369 | s390_z196_facilities="yes" | |
1370 | fi | |
1371 | fi | |
1372 | echo "s390_z196_facilities $s390_z196_facilities" | |
1b10477b MM |
1373 | |
1374 | ########################################## | |
1375 | # Check if we have required environment variables configured for libhdfs | |
1376 | if test "$libhdfs" = "yes" ; then | |
1377 | hdfs_conf_error=0 | |
1378 | if test "$JAVA_HOME" = "" ; then | |
1379 | echo "configure: JAVA_HOME should be defined to jdk/jvm path" | |
1380 | hdfs_conf_error=1 | |
1381 | fi | |
1382 | if test "$FIO_LIBHDFS_INCLUDE" = "" ; then | |
1383 | echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path" | |
1384 | hdfs_conf_error=1 | |
1385 | fi | |
1386 | if test "$FIO_LIBHDFS_LIB" = "" ; then | |
1387 | echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path" | |
1388 | hdfs_conf_error=1 | |
1389 | fi | |
1390 | if test "$hdfs_conf_error" = "1" ; then | |
1391 | exit 1 | |
1392 | fi | |
1393 | fi | |
1394 | echo "HDFS engine $libhdfs" | |
1395 | ||
b8116a87 DE |
1396 | ########################################## |
1397 | # Check whether we have MTD | |
1398 | mtd="no" | |
1399 | cat > $TMPC << EOF | |
1400 | #include <mtd/mtd-user.h> | |
1401 | #include <sys/ioctl.h> | |
1402 | int main(int argc, char **argv) | |
1403 | { | |
1404 | struct mtd_info_user info; | |
400cd0ff | 1405 | info.type = MTD_MLCNANDFLASH; |
b8116a87 DE |
1406 | return ioctl(0, MEMGETINFO, &info); |
1407 | } | |
1408 | EOF | |
1409 | if compile_prog "" "" "mtd"; then | |
1410 | mtd="yes" | |
1411 | fi | |
1412 | echo "MTD $mtd" | |
1413 | ||
b470a02c SC |
1414 | # Check if we have lex/yacc available |
1415 | yacc="no" | |
e7b2c7a3 | 1416 | yacc_is_bison="no" |
b470a02c SC |
1417 | lex="no" |
1418 | arith="no" | |
cf6dd80e | 1419 | if test "$targetos" != "SunOS" ; then |
e7b2c7a3 | 1420 | LEX=$(which lex 2> /dev/null) |
b470a02c SC |
1421 | if test -x "$LEX" ; then |
1422 | lex="yes" | |
1423 | fi | |
7e0049e9 | 1424 | YACC=$(which bison 2> /dev/null) |
b470a02c SC |
1425 | if test -x "$YACC" ; then |
1426 | yacc="yes" | |
7e0049e9 | 1427 | yacc_is_bison="yes" |
e7b2c7a3 | 1428 | else |
7e0049e9 | 1429 | YACC=$(which yacc 2> /dev/null) |
e7b2c7a3 JA |
1430 | if test -x "$YACC" ; then |
1431 | yacc="yes" | |
e7b2c7a3 | 1432 | fi |
b470a02c SC |
1433 | fi |
1434 | if test "$yacc" = "yes" && test "$lex" = "yes" ; then | |
1435 | arith="yes" | |
1436 | fi | |
1437 | ||
1438 | if test "$arith" = "yes" ; then | |
1439 | cat > $TMPC << EOF | |
1440 | extern int yywrap(void); | |
1441 | ||
1442 | int main(int argc, char **argv) | |
1443 | { | |
1444 | yywrap(); | |
1445 | return 0; | |
1446 | } | |
1447 | EOF | |
719cda03 JA |
1448 | if compile_prog "" "-ll" "lex"; then |
1449 | LIBS="-ll $LIBS" | |
b470a02c SC |
1450 | else |
1451 | arith="no" | |
1452 | fi | |
1453 | fi | |
cf6dd80e | 1454 | fi |
b470a02c SC |
1455 | |
1456 | echo "lex/yacc for arithmetic $arith" | |
1457 | ||
aae599ba JA |
1458 | ########################################## |
1459 | # Check whether we have setmntent/getmntent | |
1460 | getmntent="no" | |
1461 | cat > $TMPC << EOF | |
1462 | #include <stdio.h> | |
1463 | #include <mntent.h> | |
1464 | int main(int argc, char **argv) | |
1465 | { | |
1466 | FILE *mtab = setmntent(NULL, "r"); | |
1467 | struct mntent *mnt = getmntent(mtab); | |
1468 | endmntent(mnt); | |
1469 | return 0; | |
1470 | } | |
1471 | EOF | |
1472 | if compile_prog "" "" "getmntent"; then | |
1473 | getmntent="yes" | |
1474 | fi | |
1475 | echo "getmntent $getmntent" | |
1476 | ||
e7e136da TK |
1477 | ########################################## |
1478 | # Check whether we have getmntinfo | |
1479 | getmntinfo="no" | |
1480 | cat > $TMPC << EOF | |
1481 | #include <stdio.h> | |
1482 | #include <sys/param.h> | |
1483 | #include <sys/mount.h> | |
1484 | int main(int argc, char **argv) | |
1485 | { | |
1486 | struct statfs st; | |
1487 | return getmntinfo(&st, MNT_NOWAIT); | |
1488 | } | |
1489 | EOF | |
1490 | if compile_prog "" "" "getmntinfo"; then | |
1491 | getmntinfo="yes" | |
1492 | fi | |
1493 | echo "getmntinfo $getmntinfo" | |
1494 | ||
5018f79f AH |
1495 | ########################################## |
1496 | # Check whether we have _Static_assert | |
1497 | static_assert="no" | |
1498 | cat > $TMPC << EOF | |
1499 | #include <assert.h> | |
94815a5c JA |
1500 | #include <stdlib.h> |
1501 | #undef offsetof | |
1502 | #ifdef __compiler_offsetof | |
1503 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) | |
1504 | #else | |
1505 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | |
1506 | #endif | |
1507 | ||
1508 | #define container_of(ptr, type, member) ({ \ | |
1509 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | |
1510 | (type *)( (char *)__mptr - offsetof(type,member) );}) | |
1511 | ||
1512 | struct foo { | |
1513 | int a, b; | |
1514 | }; | |
1515 | ||
5018f79f AH |
1516 | int main(int argc, char **argv) |
1517 | { | |
94815a5c | 1518 | _Static_assert(offsetof(struct foo, a) == 0 , "Check"); |
5018f79f AH |
1519 | return 0 ; |
1520 | } | |
1521 | EOF | |
1522 | if compile_prog "" "" "static_assert"; then | |
1523 | static_assert="yes" | |
1524 | fi | |
1525 | echo "Static Assert $static_assert" | |
67bf9823 JA |
1526 | ############################################################################# |
1527 | ||
67bf9823 | 1528 | if test "$wordsize" = "64" ; then |
4feafb1e | 1529 | output_sym "CONFIG_64BIT" |
67bf9823 | 1530 | elif test "$wordsize" = "32" ; then |
4feafb1e | 1531 | output_sym "CONFIG_32BIT" |
67bf9823 | 1532 | else |
d7145a78 | 1533 | fatal "Unknown wordsize!" |
67bf9823 | 1534 | fi |
0dcebdf4 | 1535 | if test "$bigendian" = "yes" ; then |
4feafb1e | 1536 | output_sym "CONFIG_BIG_ENDIAN" |
0dcebdf4 | 1537 | else |
4feafb1e | 1538 | output_sym "CONFIG_LITTLE_ENDIAN" |
0dcebdf4 | 1539 | fi |
3989b143 JA |
1540 | if test "$zlib" = "yes" ; then |
1541 | output_sym "CONFIG_ZLIB" | |
1542 | fi | |
67bf9823 | 1543 | if test "$libaio" = "yes" ; then |
4feafb1e | 1544 | output_sym "CONFIG_LIBAIO" |
67bf9823 JA |
1545 | fi |
1546 | if test "$posix_aio" = "yes" ; then | |
4feafb1e | 1547 | output_sym "CONFIG_POSIXAIO" |
67bf9823 JA |
1548 | fi |
1549 | if test "$posix_aio_fsync" = "yes" ; then | |
4feafb1e | 1550 | output_sym "CONFIG_POSIXAIO_FSYNC" |
67bf9823 JA |
1551 | fi |
1552 | if test "$linux_fallocate" = "yes" ; then | |
4feafb1e | 1553 | output_sym "CONFIG_LINUX_FALLOCATE" |
67bf9823 JA |
1554 | fi |
1555 | if test "$posix_fallocate" = "yes" ; then | |
4feafb1e | 1556 | output_sym "CONFIG_POSIX_FALLOCATE" |
67bf9823 JA |
1557 | fi |
1558 | if test "$fdatasync" = "yes" ; then | |
4feafb1e | 1559 | output_sym "CONFIG_FDATASYNC" |
67bf9823 JA |
1560 | fi |
1561 | if test "$sync_file_range" = "yes" ; then | |
4feafb1e | 1562 | output_sym "CONFIG_SYNC_FILE_RANGE" |
67bf9823 JA |
1563 | fi |
1564 | if test "$sfaa" = "yes" ; then | |
4feafb1e | 1565 | output_sym "CONFIG_SFAA" |
67bf9823 | 1566 | fi |
954cd73a | 1567 | if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then |
4feafb1e | 1568 | output_sym "CONFIG_RDMA" |
67bf9823 JA |
1569 | fi |
1570 | if test "$clock_gettime" = "yes" ; then | |
4feafb1e | 1571 | output_sym "CONFIG_CLOCK_GETTIME" |
67bf9823 JA |
1572 | fi |
1573 | if test "$clock_monotonic" = "yes" ; then | |
4feafb1e | 1574 | output_sym "CONFIG_CLOCK_MONOTONIC" |
67bf9823 | 1575 | fi |
c544f604 SN |
1576 | if test "$clock_monotonic_raw" = "yes" ; then |
1577 | output_sym "CONFIG_CLOCK_MONOTONIC_RAW" | |
1578 | fi | |
67bf9823 | 1579 | if test "$clock_monotonic_precise" = "yes" ; then |
4feafb1e | 1580 | output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE" |
67bf9823 JA |
1581 | fi |
1582 | if test "$gettimeofday" = "yes" ; then | |
4feafb1e | 1583 | output_sym "CONFIG_GETTIMEOFDAY" |
67bf9823 JA |
1584 | fi |
1585 | if test "$posix_fadvise" = "yes" ; then | |
4feafb1e | 1586 | output_sym "CONFIG_POSIX_FADVISE" |
67bf9823 JA |
1587 | fi |
1588 | if test "$linux_3arg_affinity" = "yes" ; then | |
4feafb1e | 1589 | output_sym "CONFIG_3ARG_AFFINITY" |
67bf9823 | 1590 | elif test "$linux_2arg_affinity" = "yes" ; then |
4feafb1e | 1591 | output_sym "CONFIG_2ARG_AFFINITY" |
67bf9823 JA |
1592 | fi |
1593 | if test "$strsep" = "yes" ; then | |
4feafb1e | 1594 | output_sym "CONFIG_STRSEP" |
67bf9823 | 1595 | fi |
9ad8da82 JA |
1596 | if test "$strcasestr" = "yes" ; then |
1597 | output_sym "CONFIG_STRCASESTR" | |
1598 | fi | |
67bf9823 | 1599 | if test "$getopt_long_only" = "yes" ; then |
4feafb1e | 1600 | output_sym "CONFIG_GETOPT_LONG_ONLY" |
67bf9823 JA |
1601 | fi |
1602 | if test "$inet_aton" = "yes" ; then | |
4feafb1e | 1603 | output_sym "CONFIG_INET_ATON" |
67bf9823 JA |
1604 | fi |
1605 | if test "$socklen_t" = "yes" ; then | |
4feafb1e | 1606 | output_sym "CONFIG_SOCKLEN_T" |
67bf9823 JA |
1607 | fi |
1608 | if test "$ext4_me" = "yes" ; then | |
4feafb1e | 1609 | output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT" |
67bf9823 JA |
1610 | fi |
1611 | if test "$linux_splice" = "yes" ; then | |
4feafb1e | 1612 | output_sym "CONFIG_LINUX_SPLICE" |
67bf9823 JA |
1613 | fi |
1614 | if test "$guasi" = "yes" ; then | |
4feafb1e | 1615 | output_sym "CONFIG_GUASI" |
67bf9823 JA |
1616 | fi |
1617 | if test "$fusion_aw" = "yes" ; then | |
4feafb1e | 1618 | output_sym "CONFIG_FUSION_AW" |
67bf9823 | 1619 | fi |
50206d9b | 1620 | if test "$libnuma_v2" = "yes" ; then |
4feafb1e | 1621 | output_sym "CONFIG_LIBNUMA" |
67bf9823 JA |
1622 | fi |
1623 | if test "$solaris_aio" = "yes" ; then | |
4feafb1e | 1624 | output_sym "CONFIG_SOLARISAIO" |
67bf9823 JA |
1625 | fi |
1626 | if test "$tls_thread" = "yes" ; then | |
4feafb1e | 1627 | output_sym "CONFIG_TLS_THREAD" |
67bf9823 | 1628 | fi |
44404c5a | 1629 | if test "$rusage_thread" = "yes" ; then |
4feafb1e | 1630 | output_sym "CONFIG_RUSAGE_THREAD" |
67bf9823 | 1631 | fi |
91f94d5b JA |
1632 | if test "$gfio" = "yes" ; then |
1633 | echo "CONFIG_GFIO=y" >> $config_host_mak | |
1634 | fi | |
c8931876 JA |
1635 | if test "$esx" = "yes" ; then |
1636 | output_sym "CONFIG_ESX" | |
1637 | output_sym "CONFIG_NO_SHM" | |
1638 | fi | |
7e09a9f1 JA |
1639 | if test "$sched_idle" = "yes" ; then |
1640 | output_sym "CONFIG_SCHED_IDLE" | |
1641 | fi | |
1eafa37a JA |
1642 | if test "$tcp_nodelay" = "yes" ; then |
1643 | output_sym "CONFIG_TCP_NODELAY" | |
1644 | fi | |
1008602c JA |
1645 | if test "$window_size" = "yes" ; then |
1646 | output_sym "CONFIG_NET_WINDOWSIZE" | |
1647 | fi | |
e5f34d95 JA |
1648 | if test "$mss" = "yes" ; then |
1649 | output_sym "CONFIG_NET_MSS" | |
1650 | fi | |
38b9354a JA |
1651 | if test "$rlimit_memlock" = "yes" ; then |
1652 | output_sym "CONFIG_RLIMIT_MEMLOCK" | |
1653 | fi | |
07fc0acd JA |
1654 | if test "$pwritev" = "yes" ; then |
1655 | output_sym "CONFIG_PWRITEV" | |
1656 | fi | |
ecad55e9 JA |
1657 | if test "$ipv6" = "yes" ; then |
1658 | output_sym "CONFIG_IPV6" | |
1659 | fi | |
fc5c0345 DG |
1660 | if test "$rbd" = "yes" ; then |
1661 | output_sym "CONFIG_RBD" | |
1662 | fi | |
903b2812 JA |
1663 | if test "$rbd_inval" = "yes" ; then |
1664 | output_sym "CONFIG_RBD_INVAL" | |
1665 | fi | |
2e802282 JA |
1666 | if test "$setvbuf" = "yes" ; then |
1667 | output_sym "CONFIG_SETVBUF" | |
1668 | fi | |
81795ce3 CE |
1669 | if test "$s390_z196_facilities" = "yes" ; then |
1670 | output_sym "CONFIG_S390_Z196_FACILITIES" | |
1671 | CFLAGS="$CFLAGS -march=z9-109" | |
1672 | fi | |
6e7d7dfb | 1673 | if test "$gfapi" = "yes" ; then |
1674 | output_sym "CONFIG_GFAPI" | |
1675 | fi | |
6fa14b99 | 1676 | if test "$gf_fadvise" = "yes" ; then |
1677 | output_sym "CONFIG_GF_FADVISE" | |
1678 | fi | |
6876c98c JA |
1679 | if test "$gf_trim" = "yes" ; then |
1680 | output_sym "CONFIG_GF_TRIM" | |
1681 | fi | |
1b10477b MM |
1682 | if test "$libhdfs" = "yes" ; then |
1683 | output_sym "CONFIG_LIBHDFS" | |
1527dc50 FB |
1684 | echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak |
1685 | echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak | |
1686 | echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak | |
1687 | fi | |
b8116a87 DE |
1688 | if test "$mtd" = "yes" ; then |
1689 | output_sym "CONFIG_MTD" | |
1690 | fi | |
b470a02c SC |
1691 | if test "$arith" = "yes" ; then |
1692 | output_sym "CONFIG_ARITHMETIC" | |
e7b2c7a3 JA |
1693 | if test "$yacc_is_bison" = "yes" ; then |
1694 | echo "YACC=$YACC -y" >> $config_host_mak | |
1695 | else | |
1696 | echo "YACC=$YACC" >> $config_host_mak | |
1697 | fi | |
b470a02c | 1698 | fi |
aae599ba JA |
1699 | if test "$getmntent" = "yes" ; then |
1700 | output_sym "CONFIG_GETMNTENT" | |
1701 | fi | |
e7e136da TK |
1702 | if test "$getmntinfo" = "yes" ; then |
1703 | output_sym "CONFIG_GETMNTINFO" | |
1704 | fi | |
5018f79f AH |
1705 | if test "$static_assert" = "yes" ; then |
1706 | output_sym "CONFIG_STATIC_ASSERT" | |
1707 | fi | |
67bf9823 | 1708 | |
605cf82e JA |
1709 | if test "$zlib" = "no" ; then |
1710 | echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it." | |
1711 | fi | |
1712 | ||
67bf9823 | 1713 | echo "LIBS+=$LIBS" >> $config_host_mak |
86719845 | 1714 | echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak |
91f94d5b | 1715 | echo "CFLAGS+=$CFLAGS" >> $config_host_mak |
d2aeedb9 | 1716 | echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak |
67bf9823 | 1717 | echo "CC=$cc" >> $config_host_mak |
af4862b3 | 1718 | echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak |
020d54bd | 1719 | echo "INSTALL_PREFIX=$prefix" >> $config_host_mak |