summaryrefslogtreecommitdiff
path: root/srclib/apr/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'srclib/apr/configure.in')
-rw-r--r--srclib/apr/configure.in132
1 files changed, 132 insertions, 0 deletions
diff --git a/srclib/apr/configure.in b/srclib/apr/configure.in
index 46b4b32a..dcb6bede 100644
--- a/srclib/apr/configure.in
+++ b/srclib/apr/configure.in
@@ -20,6 +20,10 @@ sinclude(build/apr_win32.m4)
sinclude(build/apr_hints.m4)
sinclude(build/libtool.m4)
sinclude(build/ltsugar.m4)
+sinclude(build/argz.m4)
+sinclude(build/ltoptions.m4)
+sinclude(build/ltversion.m4)
+sinclude(build/lt~obsolete.m4)
dnl Hard-coded inclusion at the tail end of apr_private.h:
AH_BOTTOM([
@@ -463,6 +467,9 @@ case $host in
;;
*mingw*)
OSDIR="win32"
+ ac_cv_file__dev_zero="no"
+ ac_cv_func_setpgrp_void="no"
+ apr_cv_tcp_nodelay_with_cork="no"
enable_threads="system_threads"
eolstr="\\n"
proc_mutex_is_global=1
@@ -771,6 +778,128 @@ if test "$apr_cv_epoll" = "yes"; then
AC_DEFINE([HAVE_EPOLL], 1, [Define if the epoll interface is supported])
fi
+dnl ----------------------------- Checking for extended file descriptor handling
+# test for epoll_create1
+AC_CACHE_CHECK([for epoll_create1 support], [apr_cv_epoll_create1],
+[AC_TRY_RUN([
+#include <sys/epoll.h>
+#include <unistd.h>
+
+int main()
+{
+ return epoll_create1(0) == -1;
+}], [apr_cv_epoll_create1=yes], [apr_cv_epoll_create1=no], [apr_cv_epoll_create1=no])])
+
+if test "$apr_cv_epoll_create1" = "yes"; then
+ AC_DEFINE([HAVE_EPOLL_CREATE1], 1, [Define if epoll_create1 function is supported])
+fi
+
+# test for dup3
+AC_CACHE_CHECK([for dup3 support], [apr_cv_dup3],
+[AC_TRY_RUN([
+#include <unistd.h>
+
+int main()
+{
+ return dup3(STDOUT_FILENO, STDERR_FILENO, 0) == -1;
+}], [apr_cv_dup3=yes], [apr_cv_dup3=no], [apr_cv_dup3=no])])
+
+if test "$apr_cv_dup3" = "yes"; then
+ AC_DEFINE([HAVE_DUP3], 1, [Define if dup3 function is supported])
+fi
+
+# test for accept4
+AC_CACHE_CHECK([for accept4 support], [apr_cv_accept4],
+[AC_TRY_RUN([
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <errno.h>
+
+#define A4_SOCK "./apr_accept4_test_socket"
+
+int main()
+{
+ pid_t pid;
+ int fd;
+ struct sockaddr_un loc, rem;
+ socklen_t rem_sz;
+
+ if ((pid = fork())) {
+ int status;
+
+ unlink(A4_SOCK);
+
+ if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
+ goto cleanup_failure2;
+
+ loc.sun_family = AF_UNIX;
+ strncpy(loc.sun_path, A4_SOCK, sizeof(loc.sun_path) - 1);
+
+ if (bind(fd, (struct sockaddr *) &loc,
+ sizeof(struct sockaddr_un)) == -1)
+ goto cleanup_failure;
+
+ if (listen(fd, 5) == -1)
+ goto cleanup_failure;
+
+ rem_sz = sizeof(struct sockaddr_un);
+ if (accept4(fd, (struct sockaddr *) &rem, &rem_sz, 0) == -1) {
+ goto cleanup_failure;
+ }
+ else {
+ close(fd);
+ waitpid(pid, &status, 0);
+ unlink(A4_SOCK);
+ return 0;
+ }
+
+cleanup_failure:
+ close(fd);
+cleanup_failure2:
+ kill(pid, SIGKILL);
+ waitpid(pid, &status, 0);
+ unlink(A4_SOCK);
+ return 1;
+ }
+ else {
+ if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
+ return 1; /* this will be bad: we'll hang */
+
+ loc.sun_family = AF_UNIX;
+ strncpy(loc.sun_path, A4_SOCK, sizeof(loc.sun_path) - 1);
+
+ while(connect(fd, (struct sockaddr *) &loc,
+ sizeof(struct sockaddr_un)) == -1 &&
+ (errno==ENOENT || errno==ECONNREFUSED))
+ ;
+
+ close(fd);
+ return 0;
+ }
+}], [apr_cv_accept4=yes], [apr_cv_accept4=no], [apr_cv_accept4=no])])
+
+if test "$apr_cv_accept4" = "yes"; then
+ AC_DEFINE([HAVE_ACCEPT4], 1, [Define if accept4 function is supported])
+fi
+
+AC_CACHE_CHECK([for SOCK_CLOEXEC support], [apr_cv_sock_cloexec],
+[AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int main()
+{
+ return socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0) == -1;
+}], [apr_cv_sock_cloexec=yes], [apr_cv_sock_cloexec=no], [apr_cv_sock_cloexec=no])])
+
+if test "$apr_cv_sock_cloexec" = "yes"; then
+ AC_DEFINE([HAVE_SOCK_CLOEXEC], 1, [Define if the SOCK_CLOEXEC flag is supported])
+fi
+
dnl ----------------------------- Checking for missing POSIX thread functions
AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r])
@@ -1947,6 +2076,9 @@ fi
if test "$apr_fcntl_tryacquire_eacces" = "1"; then
AC_DEFINE(FCNTL_TRYACQUIRE_EACCES, 1, [Define if fcntl returns EACCES when F_SETLK is already held])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
fi