diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index e61cc1c3..6123ef2b 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1312,6 +1312,53 @@ int sendfile(int, int, off_t, size_t, | |||
1312 | ] | 1312 | ] |
1313 | ) | 1313 | ) |
1314 | 1314 | ||
1315 | AS_VAR_IF([[found_sendfile]], [["no"]], | ||
1316 | [ | ||
1317 | AC_MSG_CHECKING([[for Solaris-style sendfile(3)]]) | ||
1318 | SAVE_LIBS="$LIBS" | ||
1319 | LIBS="$LIBS -lsendfile" | ||
1320 | AC_LINK_IFELSE( | ||
1321 | [AC_LANG_PROGRAM( | ||
1322 | [[ | ||
1323 | #include <sys/types.h> | ||
1324 | #include <sys/socket.h> | ||
1325 | #include <sys/sendfile.h> | ||
1326 | |||
1327 | static void empty_func(void) | ||
1328 | { | ||
1329 | /* Check for declaration */ | ||
1330 | (void)sendfile; | ||
1331 | } | ||
1332 | /* Declare again to check form match */ | ||
1333 | ssize_t sendfile(int out_fd, int in_fd, | ||
1334 | off_t *off, size_t len); | ||
1335 | ]], | ||
1336 | [[ | ||
1337 | int fd1=0, fd2=1; | ||
1338 | off_t o = 0; | ||
1339 | size_t l = 5; | ||
1340 | ssize_t r; | ||
1341 | r = sendfile (fd1, fd2, &o, l); | ||
1342 | if (r) | ||
1343 | empty_func(); | ||
1344 | ]] | ||
1345 | ) | ||
1346 | ], | ||
1347 | [ | ||
1348 | AC_DEFINE([HAVE_SOLARIS_SENDFILE], [1], [Define to 1 if you have Solaris-style sendfile(3).]) | ||
1349 | found_sendfile="yes, Solaris-style" | ||
1350 | MHD_LIBDEPS="-lsendfile $MHD_LIBDEPS" | ||
1351 | MHD_LIBDEPS_PKGCFG="-lsendfile $MHD_LIBDEPS_PKGCFG" | ||
1352 | AC_MSG_RESULT([[yes]]) | ||
1353 | AC_CHECK_FUNCS([sendfile64]) | ||
1354 | ], | ||
1355 | [AC_MSG_RESULT([[no]]) | ||
1356 | ] | ||
1357 | ) | ||
1358 | LIBS="$SAVE_LIBS" | ||
1359 | ] | ||
1360 | ) | ||
1361 | |||
1315 | # optional: have error messages ? | 1362 | # optional: have error messages ? |
1316 | AC_MSG_CHECKING([[whether to generate error messages]]) | 1363 | AC_MSG_CHECKING([[whether to generate error messages]]) |
1317 | AC_ARG_ENABLE([messages], | 1364 | AC_ARG_ENABLE([messages], |