diff options
author | Björn Jacke <bj@sernet.de> | 2012-09-14 00:02:22 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2012-11-01 09:10:37 +0100 |
commit | a812254ce8bbe67234a185054661e6c2f01b1134 (patch) | |
tree | 7b3736154e6326a9f8f29bfc937fdda3db7e8d1c | |
parent | 84cee26dfac47f3a8cb47b6b58da9290d4fde41a (diff) | |
download | samba-a812254ce8bbe67234a185054661e6c2f01b1134.tar.gz |
autoconf: fix --with(out)-sendfile-support option handling
this fixes bug #8344
(cherry picked from commit a1db9aada46e2e7eefc989f888d22650320533de)
(cherry picked from commit f156a357e6af0aaa6b1bcddc521761d43409e70f)
-rw-r--r-- | source3/configure.in | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/source3/configure.in b/source3/configure.in index 24945936d92..9d7fb5ddeb3 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -5696,16 +5696,23 @@ fi ################################################# # check for sendfile support -with_sendfile_support=yes -AC_MSG_CHECKING(whether to check to support sendfile) +AC_MSG_CHECKING(whether sendfile support should be built in) AC_ARG_WITH(sendfile-support, -[AS_HELP_STRING([--with-sendfile-support], [Check for sendfile support (default=yes)])], +[AS_HELP_STRING([--with-sendfile-support], [Whether sendfile support should be built in (default=auto)])], [ case "$withval" in - yes) - - AC_MSG_RESULT(yes); + yes|no) + AC_MSG_RESULT($withval); + with_sendfile_support=$withval + ;; + *) + AC_MSG_RESULT(yes) + with_sendfile_support=auto + ;; + esac ], +) - case "$host_os" in +if test x$with_sendfile_support != xno ; then + case "$host_os" in *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu) AC_CACHE_CHECK([for linux sendfile64 support],samba_cv_HAVE_SENDFILE64,[ AC_TRY_LINK([#include <sys/sendfile.h>], @@ -5941,14 +5948,12 @@ samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) ;; *) ;; - esac - ;; - *) - AC_MSG_RESULT(no) - ;; - esac ], - AC_MSG_RESULT(yes) -) + esac +fi + +if test x$with_sendfile_support = xyes -a x"$samba_cv_HAVE_SENDFILE" != xyes ; then + AC_MSG_ERROR(sendfile support requested but sendfile not available ) +fi ############################################ # See if we have the Linux readahead syscall. |