Enable IPv6 in the Windows build
[fio.git] / configure
index 87d659cf6c70cfecbf94e0bbc33e909e448fbaaa..78a6ccb7e746aa2e272a68bccd96c8c821084034 100755 (executable)
--- a/configure
+++ b/configure
@@ -148,11 +148,13 @@ for opt do
   ;;
   --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
   ;;
-  --build-32bit-win=*) build_32bit_win="$optarg"
+  --build-32bit-win) build_32bit_win="yes"
   ;;
   --enable-gfio)
   gfio="yes"
   ;;
+  --disable-numa) disable_numa="yes"
+  ;;
   --help)
     show_help="yes"
     ;;
@@ -167,8 +169,9 @@ if test "$show_help" = "yes" ; then
   echo "--cpu=                 Specify target CPU if auto-detect fails"
   echo "--cc=                  Specify compiler to use"
   echo "--extra-cflags=        Specify extra CFLAGS to pass to compiler"
-  echo "--build-32bit-win=     Specify yes for a 32-bit build on Windows"
+  echo "--build-32bit-win      Enable 32-bit build on Windows"
   echo "--enable-gfio          Enable building of gtk gfio"
+  echo "--disable-numa         Disable libnuma even if found"
   exit $exit_val
 fi
 
@@ -180,6 +183,7 @@ elif check_define __OpenBSD__ ; then
   targetos='OpenBSD'
 elif check_define __sun__ ; then
   targetos='SunOS'
+  CFLAGS="$CFLAGS -D_REENTRANT"
 else
   targetos=`uname -s`
 fi
@@ -239,6 +243,8 @@ CYGWIN*)
   output_sym "CONFIG_CLOCK_GETTIME"
   output_sym "CONFIG_SCHED_IDLE"
   output_sym "CONFIG_TCP_NODELAY"
+  output_sym "CONFIG_TLS_THREAD"
+  output_sym "CONFIG_IPV6"
   echo "CC=$CC" >> $config_host_mak
   echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
   exit 0
@@ -415,9 +421,6 @@ EOF
 if compile_prog "" "-lz" "zlib" ; then
   zlib=yes
   LIBS="-lz $LIBS"
-else
-  feature_not_found "zlib" "zlib development files"
-  zlib=no
 fi
 echo "zlib                          $zlib"
 
@@ -569,6 +572,7 @@ echo "rdmacm                        $rdmacm"
 linux_fallocate="no"
 cat > $TMPC << EOF
 #include <stdio.h>
+#include <fcntl.h>
 #include <linux/falloc.h>
 int main(int argc, char **argv)
 {
@@ -812,15 +816,18 @@ echo "GUASI                         $guasi"
 # fusion-aw probe
 fusion_aw="no"
 cat > $TMPC << EOF
-#include <nvm/vectored_write.h>
+#include <nvm/nvm_primitives.h>
 int main(int argc, char **argv)
 {
-  struct vsl_iovec iov;
-  return vsl_vectored_write(0, &iov, 0, O_ATOMIC);
+  nvm_version_t ver_info;
+  nvm_handle_t handle;
+
+  handle = nvm_get_handle(0, &ver_info);
+  return nvm_atomic_write(handle, 0, 0, 0);
 }
 EOF
-if compile_prog "" "-L/usr/lib/fio -lnvm-primitives" "fusion-aw"; then
-  LIBS="-L/usr/lib/fio -lnvm-primitives $LIBS"
+if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl" "fusion-aw"; then
+  LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -lvsl -ldl $LIBS"
   fusion_aw="yes"
 fi
 echo "Fusion-io atomic engine       $fusion_aw"
@@ -835,7 +842,7 @@ int main(int argc, char **argv)
   return numa_available();
 }
 EOF
-if compile_prog "" "-lnuma" "libnuma"; then
+if test "$disable_numa" != "yes"  && compile_prog "" "-lnuma" "libnuma"; then
   libnuma="yes"
   LIBS="-lnuma $LIBS"
 fi
@@ -882,8 +889,7 @@ cat > $TMPC << EOF
 #include <string.h>
 int main(int argc, char **argv)
 {
-  strcasestr(NULL, NULL);
-  return 0;
+  return strcasestr(argv[0], argv[1]) != NULL;
 }
 EOF
 if compile_prog "" "" "strcasestr"; then
@@ -897,6 +903,7 @@ getopt_long_only="no"
 cat > $TMPC << EOF
 #include <unistd.h>
 #include <stdio.h>
+#include <getopt.h>
 int main(int argc, char **argv)
 {
   int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
@@ -947,7 +954,7 @@ echo "socklen_t                     $socklen_t"
 tls_thread="no"
 cat > $TMPC << EOF
 #include <stdio.h>
-static int __thread ret;
+static __thread int ret;
 int main(int argc, char **argv)
 {
   return ret;
@@ -1069,6 +1076,48 @@ if compile_prog "" "" "RLIMIT_MEMLOCK"; then
 fi
 echo "RLIMIT_MEMLOCK                $rlimit_memlock"
 
+##########################################
+# 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 <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"
+
 #############################################################################
 
 if test "$wordsize" = "64" ; then
@@ -1083,6 +1132,9 @@ if test "$bigendian" = "yes" ; then
 else
   output_sym "CONFIG_LITTLE_ENDIAN"
 fi
+if test "$zlib" = "yes" ; then
+  output_sym "CONFIG_ZLIB"
+fi
 if test "$libaio" = "yes" ; then
   output_sym "CONFIG_LIBAIO"
 fi
@@ -1107,7 +1159,7 @@ fi
 if test "$sfaa" = "yes" ; then
   output_sym "CONFIG_SFAA"
 fi
-if test "$libverbs" = "yes" -a "rdmacm" = "yes" ; then
+if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
   output_sym "CONFIG_RDMA"
 fi
 if test "$clock_gettime" = "yes" ; then
@@ -1181,6 +1233,12 @@ fi
 if test "$rlimit_memlock" = "yes" ; then
   output_sym "CONFIG_RLIMIT_MEMLOCK"
 fi
+if test "$pwritev" = "yes" ; then
+  output_sym "CONFIG_PWRITEV"
+fi
+if test "$ipv6" = "yes" ; then
+  output_sym "CONFIG_IPV6"
+fi
 
 echo "LIBS+=$LIBS" >> $config_host_mak
 echo "CFLAGS+=$CFLAGS" >> $config_host_mak