summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-06-27 22:06:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:58:04 -0500
commit15c6ae15c845c42dda2eb9c649d40df087d51441 (patch)
treec2f817c85a20525221d92bc740b0097c51f7b53a
parenta8961434c089a37d21d956a17a34e656eb434fd3 (diff)
downloadsamba-15c6ae15c845c42dda2eb9c649d40df087d51441.tar.gz
samba-15c6ae15c845c42dda2eb9c649d40df087d51441.tar.bz2
samba-15c6ae15c845c42dda2eb9c649d40df087d51441.zip
r7957: Added aio configure support. Jerry told me to :-).
Jeremy. (This used to be commit 5b5052c0422d88c9ca7d42f5ac7afec4d0e6b647)
-rw-r--r--source3/configure.in67
1 files changed, 66 insertions, 1 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 14fd135093..e35c95d932 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -700,7 +700,7 @@ AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h)
+AC_CHECK_HEADERS(aio.h arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h)
AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h)
AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/nis.h rpcsvc/ypclnt.h)
## These fail to compile on IRIX so just check for their presence
@@ -881,6 +881,20 @@ if test x"$samba_cv_sig_atomic_t" = x"yes"; then
AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
fi
+AC_CACHE_CHECK([for struct timespec type],samba_cv_struct_timespec, [
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <time.h>
+#include <aio.h>],[struct timespec ts;],
+ samba_cv_struct_timespec=yes,samba_cv_struct_timespec=no)])
+if test x"$samba_cv_struct_timespec" = x"yes"; then
+ AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec])
+fi
+
# stupid headers have the functions but no declaration. grrrr.
AC_HAVE_DECL(errno, [#include <errno.h>])
AC_HAVE_DECL(setresuid, [#include <unistd.h>])
@@ -4052,6 +4066,57 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)
)
#################################################
+# check for AIO support
+
+AC_MSG_CHECKING(whether to support asynchronous io)
+AC_ARG_WITH(aio-support,
+[ --with-aio-support Include asynchronous io support (default=no)],
+[ case "$withval" in
+ yes)
+
+ case "$host_os" in
+ *)
+ AC_CHECK_LIB(rt,aio_read,[AIO_LIBS="$ACL_LIBS -lrt"])
+ AC_CACHE_CHECK([for asynchronous io support],samba_cv_HAVE_AIO,[
+ aio_LIBS=$LIBS
+ LIBS="$LIBS -lrt"
+ AC_TRY_LINK([#include <sys/types.h>
+#include <aio.h>],
+[ struct aiocb a; return aio_read(&a);],
+samba_cv_HAVE_AIO=yes,samba_cv_HAVE_AIO=no)
+ LIBS=$aio_LIBS])
+ AC_CACHE_CHECK([for 64-bit asynchronous io support],samba_cv_HAVE_AIO64,[
+ aio_LIBS=$LIBS
+ LIBS="$LIBS -lrt"
+ AC_TRY_LINK([#include <sys/types.h>
+#include <aio.h>],
+[ struct aiocb64 a; return aio_read64(&a);],
+samba_cv_HAVE_AIO64=yes,samba_cv_HAVE_AIO64=no)
+ LIBS=$aio_LIBS])
+ if test x"$samba_cv_HAVE_AIO64" = x"yes"; then
+ AC_DEFINE(HAVE_AIOCB64,1,[Whether 64 bit aio is available])
+ AC_DEFINE(WITH_AIO, 1, [Using asynchronous io])
+ LIBS="$LIBS -lrt"
+ elif test x"$samba_cv_HAVE_AIO" = x"yes"; then
+ AC_DEFINE(WITH_AIO, 1, [Using asynchronous io])
+ LIBS="$LIBS -lrt"
+ fi
+ ;;
+ esac
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ AC_DEFINE(HAVE_NO_AIO,1,[Whether no asynchronous io support is available])
+ ;;
+ esac ],
+ AC_DEFINE(HAVE_NO_AIO,1,[Whether no asynchronous io support should be built in])
+ AC_MSG_RESULT(no)
+)
+
+AC_CHECK_FUNCS(aio_cancel aio_cancel64 aio_error aio_error64 aio_fsync aio_fsync64 aio_read aio_read64)
+AC_CHECK_FUNCS(aio_return aio_return64 aio_suspend aio_suspend64 aio_write aio_write64)
+
+#################################################
# check for sendfile support
with_sendfile_support=yes