Branch: Tag:

2006-12-15

2006-12-15 15:27:22 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now checks for epoll availability.

Rev: src/configure.in:1.1004

1: - AC_REVISION("$Id: configure.in,v 1.1003 2006/10/06 08:00:35 stewa Exp $") + AC_REVISION("$Id: configure.in,v 1.1004 2006/12/15 15:27:22 grubba Exp $")   AC_INIT(interpret.c)   AC_CONFIG_HEADER(machine.h)   
2296:    # MinGW system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1003 2006/10/06 08:00:35 stewa Exp $. + # Automatically generated by $Id: configure.in,v 1.1004 2006/12/15 15:27:22 grubba Exp $.   # MinGW-version. Do NOT edit.   posix_name="`cat`"   posix_prefix="/"
2334:    # Native POSIX system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1003 2006/10/06 08:00:35 stewa Exp $. + # Automatically generated by $Id: configure.in,v 1.1004 2006/12/15 15:27:22 grubba Exp $.   # POSIX-version. Do NOT edit.   cat   EOF
2343:    # rntcl-style    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1003 2006/10/06 08:00:35 stewa Exp $. + # Automatically generated by $Id: configure.in,v 1.1004 2006/12/15 15:27:22 grubba Exp $.   # RNTCL-version. Do NOT edit.   sed -e "$PIKE_PATH_TRANSLATE"   EOF
3133:    if test "x$pike_cv_poll_device" = "xno"; then :; else    AC_DEFINE_UNQUOTED(PIKE_POLL_DEVICE, "$pike_cv_poll_device")    fi +  +  if test "x$ac_cv_header_sys_epoll" = "xyes"; then +  AC_MSG_CHECKING(if epoll is available) +  AC_CACHE_VAL(pike_cv_epoll_works, [ +  if test "x$pike_cv_poll_device" = "xno"; then +  AC_TRY_RUN([ + #ifdef HAVE_ERRNO_H + #include <errno.h> + #endif + #include <sys/epoll.h> + #ifdef __stub_epoll_create + /* We have a libc without the wrappers for epoll support. +  */ + #ifdef HAVE_SYSCALL_H + #include <syscall.h> + #elif defined(HAVE_SYS_SYSCALL_H) + #include <sys/syscall.h> + #endif /* HAVE_SYSCALL_H || HAVE_SYS_SYSCALL_H */ + #ifndef __NR_epoll_create + /* Our libc does not even know the syscall numbers for the epoll syscalls. +  */ + #ifdef __i386__ + #define __NR_epoll_create 254 + #elif defined(__ia64__) + #define __NR_epoll_create 1243 + #elif defined(__x86_64__) + #define __NR_epoll_create 214 + #else /* cpu types */ + #error Syscall numbers for epoll_create et al not known on this architecture. + #endif /* cpu types */ + #endif /* !defined(__NR_epoll_create) */ +  + #if defined(_syscall1) && defined(_syscall4) + _syscall1(int, epoll_create, int, size); + #undef __stub_epoll_create + #else /* !_syscall1 || !_syscall4 */ + #error Missing macros for generation of syscall wrappers. + #endif /* _syscall1 && _syscall4 */ + #endif /* __stub_epoll_{create, ctl, wait} */ + int main(int argc, char **argv) + { +  int fd; +  do { +  fd = epoll_create(); +  } while ((fd < 0) && (errno == EINTR)); +  return fd < 0; + } +  ], [ +  pike_cv_epoll_works=yes +  ], [ +  pike_cv_epoll_works=no +  ], [ +  pike_cv_epoll_works=unknown +  ]) +  else +  pike_cv_epoll_works=yes    fi -  +  ]) +  AC_MSG_RESULT($pike_cv_epoll_works) +  if test "x$pike_cv_epoll_works" = "xyes"; then +  AC_DEFINE(PIKE_WITH_EPOLL) +  fi +  fi + fi      # some Linux systems have a broken resource.h that compiles anyway /Mirar   AC_MSG_CHECKING([for sys/resource.h])