feature_not_found() {
feature=$1
+ packages=$2
echo "ERROR"
echo "ERROR: User requested feature $feature"
+ if test ! -z "$packages" ; then
+ echo "ERROR: That feature needs $packages installed"
+ fi
echo "ERROR: configure was not able to find it"
fatal "ERROR"
}
;;
--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"
;;
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
targetos='OpenBSD'
elif check_define __sun__ ; then
targetos='SunOS'
+ CFLAGS="$CFLAGS -D_REENTRANT"
else
targetos=`uname -s`
fi
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
if compile_prog "" "-lz" "zlib" ; then
zlib=yes
LIBS="-lz $LIBS"
-else
- feature_not_found "zlib"
- zlib=no
fi
echo "zlib $zlib"
LIBS="-laio $LIBS"
else
if test "$libaio" = "yes" ; then
- feature_not_found "linux AIO"
+ feature_not_found "linux AIO" "libaio-dev or libaio-devel"
fi
libaio=no
fi
linux_fallocate="no"
cat > $TMPC << EOF
#include <stdio.h>
+#include <fcntl.h>
#include <linux/falloc.h>
int main(int argc, char **argv)
{
# 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"
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
#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
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);
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;
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 <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"
+
#############################################################################
if test "$wordsize" = "64" ; 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
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
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