Better check for epoll().
[silc.git] / lib / configure.ad
index 889a74b1ae47fd76da5c3467f8b23d95b2184fa7..6da5e7c572f3581f8d5d0f68443dd448b760bc9c 100644 (file)
@@ -4,7 +4,7 @@
 #
 #  Author: Pekka Riikonen <priikone@silcnet.org>
 #
-#  Copyright (C) 2005 Pekka Riikonen
+#  Copyright (C) 2005, 2007 Pekka Riikonen
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -110,6 +110,27 @@ AC_SUBST(LIBSILCSERVER_AGE)
 # Check for big-endian machines
 AC_C_BIGENDIAN
 
+# Check for epoll_wait and verify that epoll_create works
+AC_CHECK_FUNC(epoll_wait,
+  [
+    AC_RUN_IFELSE(
+      [
+        #include <sys/epoll.h>
+        int main()
+        {
+          int ret = epoll_create(5);
+          if (ret < 0)
+            return 1;
+          close(ret);
+          return 0;
+        }
+      ],
+      [
+        AC_DEFINE([HAVE_EPOLL_WAIT], [1], [HAVE_EPOLL_WAIT])
+      ],
+    )
+  ])
+
 #ifdef SILC_DIST_SIM
 # SIM modules directory
 #
@@ -207,9 +228,6 @@ lib/silcske/Makefile
 lib/silcutil/Makefile
 lib/silcutil/unix/Makefile
 lib/silcutil/win32/Makefile
-lib/silcutil/beos/Makefile
-lib/silcutil/os2/Makefile
-lib/silcutil/epoc/Makefile
 lib/silcapputil/Makefile
 #ifdef SILC_DIST_SFTP
 lib/silcsftp/Makefile