+##########################################
+# Check whether we have pwritev/preadv
+pwritev="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <sys/uio.h>
+int main(int argc, char **argv)
+{
+ return pwritev(0, NULL, 1, 0) + preadv(0, NULL, 1, 0);
+}
+EOF
+if compile_prog "" "" "pwritev"; then
+ pwritev="yes"
+fi
+echo "pwritev/preadv $pwritev"
+
+##########################################
+# Check whether we have the required functions for ipv6
+ipv6="no"
+cat > $TMPC << EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+ struct addrinfo hints;
+ struct in6_addr addr;
+ int ret;
+
+ ret = getaddrinfo(NULL, NULL, &hints, NULL);
+ freeaddrinfo(NULL);
+ printf("%s\n", gai_strerror(ret));
+ addr = in6addr_any;
+ return 0;
+}
+EOF
+if compile_prog "" "" "ipv6"; then
+ ipv6="yes"
+fi
+echo "IPv6 helpers $ipv6"
+
+##########################################
+# check for rbd
+rbd="no"
+cat > $TMPC << EOF
+#include <rbd/librbd.h>
+
+int main(int argc, char **argv)
+{
+
+ rados_t cluster;
+ rados_ioctx_t io_ctx;
+ const char pool[] = "rbd";
+
+ int major, minor, extra;
+ rbd_version(&major, &minor, &extra);
+
+ rados_ioctx_create(cluster, pool, &io_ctx);
+ return 0;
+}
+EOF
+if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
+ LIBS="-lrbd -lrados $LIBS"
+ rbd="yes"
+fi
+echo "Rados Block Device engine $rbd"
+
+##########################################
+# Check whether we have setvbuf
+setvbuf="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+ FILE *f = NULL;
+ char buf[80];
+ setvbuf(f, buf, _IOFBF, sizeof(buf));
+ return 0;
+}
+EOF
+if compile_prog "" "" "setvbuf"; then
+ setvbuf="yes"
+fi
+echo "setvbuf $setvbuf"
+
+# check for gfapi
+gfapi="no"
+cat > $TMPC << EOF
+#include <glusterfs/api/glfs.h>
+
+int main(int argc, char **argv)
+{
+
+ glfs_t *g = glfs_new("foo");
+
+ return 0;
+}
+EOF
+if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
+ LIBS="-lgfapi -lglusterfs $LIBS"
+ gfapi="yes"
+fi
+ echo "Gluster API engine $gfapi"
+
+##########################################
+# check for gfapi fadvise support
+gf_fadvise="no"
+cat > $TMPC << EOF
+#include <glusterfs/api/glfs.h>
+
+int main(int argc, char **argv)
+{
+ struct glfs_fd *fd;
+ int ret = glfs_fadvise(fd, 0, 0, 1);
+
+ return 0;
+}
+EOF
+
+if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
+ gf_fadvise="yes"
+fi
+echo "Gluster API use fadvise $gf_fadvise"
+
+##########################################
+# Check if we support stckf on s390
+s390_z196_facilities="no"
+cat > $TMPC << EOF
+#define STFLE_BITS_Z196 45 /* various z196 facilities ... */
+int main(int argc, char **argv)
+{
+ /* We want just 1 double word to be returned. */
+ register unsigned long reg0 asm("0") = 0;
+ unsigned long stfle_bits;
+ asm volatile(".machine push" "\n\t"
+ ".machine \"z9-109\"" "\n\t"
+ "stfle %0" "\n\t"
+ ".machine pop" "\n"
+ : "=QS" (stfle_bits), "+d" (reg0)
+ : : "cc");
+
+ if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
+ return 0;
+ else
+ return -1;
+}
+EOF
+if compile_prog "" "" "s390_z196_facilities"; then
+ $TMPE
+ if [[ $? -eq 0 ]]; then
+ s390_z196_facilities="yes"
+ fi
+fi
+echo "s390_z196_facilities $s390_z196_facilities"
+
+##########################################
+# Check if we have required environment variables configured for libhdfs
+if test "$libhdfs" = "yes" ; then
+ hdfs_conf_error=0
+ if test "$JAVA_HOME" = "" ; then
+ echo "configure: JAVA_HOME should be defined to jdk/jvm path"
+ hdfs_conf_error=1
+ fi
+ if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
+ echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs inlude path"
+ hdfs_conf_error=1
+ fi
+ if test "$FIO_LIBHDFS_LIB" = "" ; then
+ echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
+ hdfs_conf_error=1
+ fi
+ if test "$hdfs_conf_error" = "1" ; then
+ exit 1
+ fi
+fi
+echo "HDFS engine $libhdfs"
+
+# Check if we have lex/yacc available
+yacc="no"
+yacc_is_bison="no"
+lex="no"
+arith="no"
+LEX=$(which lex 2> /dev/null)
+if test -x "$LEX" ; then
+ lex="yes"
+fi
+YACC=$(which bison 2> /dev/null)
+if test -x "$YACC" ; then
+ yacc="yes"
+ yacc_is_bison="yes"
+else
+ YACC=$(which yacc 2> /dev/null)
+ if test -x "$YACC" ; then
+ yacc="yes"
+ fi
+fi
+if test "$yacc" = "yes" && test "$lex" = "yes" ; then
+ arith="yes"
+fi
+
+if test "$arith" = "yes" ; then
+cat > $TMPC << EOF
+extern int yywrap(void);
+
+int main(int argc, char **argv)
+{
+ yywrap();
+ return 0;
+}
+EOF
+
+if compile_prog "" "-ll" "lex"; then
+ LIBS="-ll $LIBS"
+else
+ arith="no"
+fi
+fi
+
+echo "lex/yacc for arithmetic $arith"
+