diff options
author | Jeremy Allison <jra@samba.org> | 2002-09-17 00:45:39 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-09-17 00:45:39 +0000 |
commit | ad5ab5f5832844dc6eff3f2c72d24eba5e8b4d29 (patch) | |
tree | f174c47a73a5d4402705d2f89fbc70e89610b98f /source3/configure.in | |
parent | 52e22d7384ef86937938b93c18a2460614e60bc6 (diff) | |
download | samba-ad5ab5f5832844dc6eff3f2c72d24eba5e8b4d29.tar.gz samba-ad5ab5f5832844dc6eff3f2c72d24eba5e8b4d29.tar.bz2 samba-ad5ab5f5832844dc6eff3f2c72d24eba5e8b4d29.zip |
Added autoconf detection for sendfile for Linux. lib/sendfile.c code
still needs more work. Don't add --with-sendfile-support yet...
Jeremy.
(This used to be commit c6ece53ac2a7a6115ca1160cf02247d7cc0bbb95)
Diffstat (limited to 'source3/configure.in')
-rw-r--r-- | source3/configure.in | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in index fd08142bbd..76dc380c13 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -2662,6 +2662,78 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)]) ) ################################################# +# check for sendfile support + +AC_MSG_CHECKING(whether to support sendfile) +AC_ARG_WITH(sendfile-support, +[ --with-sendfile-support Include sendfile support (default=no)], +[ case "$withval" in + yes) + + case "$host_os" in + *linux*) + AC_CACHE_CHECK([for sendfile64 support],samba_cv_HAVE_SENDFILE64,[ + AC_TRY_LINK([#include <sys/sendfile.h>], +[\ +int tofd, fromfd; +off64_t offset; +size_t total; +ssize_t nwritten = sendfile64(tofd, fromfd, &offset, total); +], +samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)]) + + AC_CACHE_CHECK([for sendfile support],samba_cv_HAVE_SENDFILE,[ + AC_TRY_LINK([#include <sys/sendfile.h>], +[\ +int tofd, fromfd; +off_t offset; +size_t total; +ssize_t nwritten = sendfile(tofd, fromfd, &offset, total); +], +samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) + +# Try and cope with broken Linux sendfile.... + AC_CACHE_CHECK([for broken linux sendfile support],samba_cv_HAVE_BROKEN_LINUX_SENDFILE,[ + AC_TRY_LINK([\ +#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) +#undef _FILE_OFFSET_BITS +#endif +#include <sys/sendfile.h>], +[\ +int tofd, fromfd; +off_t offset; +size_t total; +ssize_t nwritten = sendfile(tofd, fromfd, &offset, total); +], +samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no)]) + + if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE64) + AC_DEFINE(LINUX_SENDFILE_API) + elif test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE) + AC_DEFINE(LINUX_SENDFILE_API) + elif test x"$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE) + AC_DEFINE(LINUX_BROKEN_SENDFILE_API) + else + AC_MSG_RESULT(no); + fi + + ;; + *) + ;; + esac + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + + +################################################# # Check whether winbind is supported on this platform. If so we need to # build and install client programs (WINBIND_TARGETS), sbin programs # (WINBIND_STARGETS) and shared libraries (WINBIND_LTARGETS). |