server: Added support for kqueue() as an alternative to poll() on FreeBSD.
diff --git a/configure b/configure
index 90aa97e..448115d 100755
--- a/configure
+++ b/configure
@@ -4118,12 +4118,12 @@
     X_LIBS="$X_LIBS -L$x_libraries"
     # For Solaris; some versions of Sun CC require a space after -R and
     # others require no space.  Words are not sufficient . . . .
-    case `(uname -sr) 2>/dev/null` in
-    "SunOS 5"*)
-      { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+    { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; }
-      ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
-      cat >conftest.$ac_ext <<_ACEOF
+    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+    ac_xsave_c_werror_flag=$ac_c_werror_flag
+    ac_c_werror_flag=yes
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4172,23 +4172,15 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_R_nospace=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_R_nospace=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-      if test $ac_R_nospace = yes; then
-	{ echo "$as_me:$LINENO: result: no" >&5
+  { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
-	X_LIBS="$X_LIBS -R$x_libraries"
-      else
+       X_LIBS="$X_LIBS -R$x_libraries"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
-	cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4237,27 +4229,25 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_R_space=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_R_space=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-	if test $ac_R_space = yes; then
-	  { echo "$as_me:$LINENO: result: yes" >&5
+  { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
 	  X_LIBS="$X_LIBS -R $x_libraries"
-	else
-	  { echo "$as_me:$LINENO: result: neither works" >&5
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ echo "$as_me:$LINENO: result: neither works" >&5
 echo "${ECHO_T}neither works" >&6; }
-	fi
-      fi
-      LIBS=$ac_xsave_LIBS
-    esac
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    ac_c_werror_flag=$ac_xsave_c_werror_flag
+    LIBS=$ac_xsave_LIBS
   fi
 
   # Check for system-dependent libraries X programs must link with.
@@ -8436,6 +8426,7 @@
 
 
 
+
 for ac_header in \
 	AudioUnit/AudioUnit.h \
 	CoreAudio/CoreAudio.h \
@@ -8504,6 +8495,7 @@
 	sys/elf32.h \
 	sys/epoll.h \
 	sys/errno.h \
+	sys/event.h \
 	sys/exec_elf.h \
 	sys/filio.h \
 	sys/ioctl.h \
@@ -19349,6 +19341,7 @@
 
 
 
+
 for ac_func in \
 	_lwp_create \
 	_lwp_self \
@@ -19385,6 +19378,7 @@
 	gettimeofday \
 	getuid \
 	inet_network \
+	kqueue \
 	lstat \
 	memmove \
 	mmap \