diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-10-01 18:44:45 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-10-01 18:44:45 +0300 |
commit | e127b8a6c4a0a72b5786c50a9b46196143e7af6c (patch) | |
tree | 8f4da7818933d375ea812a2c6b70e25b0109c7ec /configure.ac | |
parent | 404d4b4472f5714a7e32422e5aa663b964f97652 (diff) | |
download | libmicrohttpd-e127b8a6c4a0a72b5786c50a9b46196143e7af6c.tar.gz libmicrohttpd-e127b8a6c4a0a72b5786c50a9b46196143e7af6c.zip |
Added detection for Linux form of sendfile(2)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 683347ad..e4810e62 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1229,7 +1229,43 @@ AM_CONDITIONAL([HAVE_LIBMAGIC], [[test "x$mhd_have_libmagic" = "xyes"]]) | |||
1229 | # large file support (> 4 GB) | 1229 | # large file support (> 4 GB) |
1230 | AC_SYS_LARGEFILE | 1230 | AC_SYS_LARGEFILE |
1231 | AC_FUNC_FSEEKO | 1231 | AC_FUNC_FSEEKO |
1232 | AC_CHECK_FUNCS([lseek64 sendfile64 pread64 pread]) | 1232 | AC_CHECK_FUNCS([lseek64 pread64 pread]) |
1233 | |||
1234 | # check for various sendfile functions | ||
1235 | found_sendfile="no" | ||
1236 | AC_MSG_CHECKING([[for Linux-style sendfile(2)]]) | ||
1237 | AC_LINK_IFELSE( | ||
1238 | [AC_LANG_PROGRAM( | ||
1239 | [[ | ||
1240 | #include <sys/sendfile.h> | ||
1241 | |||
1242 | static void empty_func(void) | ||
1243 | { | ||
1244 | /* Check for declaration */ | ||
1245 | (void)sendfile; | ||
1246 | } | ||
1247 | /* Declare again to check form match */ | ||
1248 | ssize_t sendfile(int, int, off_t*, size_t); | ||
1249 | ]], | ||
1250 | [[ | ||
1251 | int fd1, fd2; | ||
1252 | off_t o = 0; | ||
1253 | size_t s = 5; | ||
1254 | ssize_t r; | ||
1255 | r = sendfile (fd1, fd2, &o, s); | ||
1256 | empty_func(); | ||
1257 | ]] | ||
1258 | ) | ||
1259 | ], | ||
1260 | [ | ||
1261 | AC_DEFINE([HAVE_LINUX_SENDFILE], [1], [Define to 1 if you have linux-style sendfile(2).]) | ||
1262 | found_sendfile="yes, linux-style" | ||
1263 | AC_MSG_RESULT([[yes]]) | ||
1264 | AC_CHECK_FUNCS([sendfile64]) | ||
1265 | ], | ||
1266 | [AC_MSG_RESULT([[no]]) | ||
1267 | ] | ||
1268 | ) | ||
1233 | 1269 | ||
1234 | # optional: have error messages ? | 1270 | # optional: have error messages ? |
1235 | AC_MSG_CHECKING([[whether to generate error messages]]) | 1271 | AC_MSG_CHECKING([[whether to generate error messages]]) |
@@ -1781,6 +1817,7 @@ AC_MSG_NOTICE([libmicrohttpd ${PACKAGE_VERSION} Configuration Summary: | |||
1781 | HTTPS support: ${MSG_HTTPS} | 1817 | HTTPS support: ${MSG_HTTPS} |
1782 | poll support: ${enable_poll=no} | 1818 | poll support: ${enable_poll=no} |
1783 | epoll support: ${enable_epoll=no} | 1819 | epoll support: ${enable_epoll=no} |
1820 | sendfile used: ${found_sendfile} | ||
1784 | build docs: ${enable_doc} | 1821 | build docs: ${enable_doc} |
1785 | build examples: ${enable_examples} | 1822 | build examples: ${enable_examples} |
1786 | ]) | 1823 | ]) |