poll: fix typo that broke test on MacOS
[gnulib.git] / m4 / poll.m4
index c427b09..3859597 100644 (file)
@@ -1,13 +1,15 @@
-# poll.m4 serial 9
-dnl Copyright (c) 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+# poll.m4 serial 11
+dnl Copyright (c) 2003, 2005, 2006, 2007, 2009, 2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_POLL],
 [
-  AC_CHECK_HEADERS([poll.h])
+  AC_REQUIRE([gl_POLL_H])
   if test "$ac_cv_header_poll_h" = no; then
+    ac_cv_func_poll=no
     gl_cv_func_poll=no
   else
     AC_CHECK_FUNC([poll],
@@ -50,18 +52,22 @@ This is MacOSX or AIX
 #endif
 ], [gl_cv_func_poll=no], [gl_cv_func_poll=yes])])])
   fi
-  if test $gl_cv_func_poll = yes; then
-    AC_DEFINE([HAVE_POLL], [1],
-      [Define to 1 if you have the 'poll' function and it works.])
-    POLL_H=
-  else
+  if test $gl_cv_func_poll != yes; then
+    AC_CHECK_FUNC([poll], [ac_cv_func_poll=yes], [ac_cv_func_poll=no])
+    if test $ac_cv_func_poll = no; then
+      HAVE_POLL=0
+    else
+      REPLACE_POLL=1
+    fi
+  fi
+  if test $HAVE_POLL = 0 || test $REPLACE_POLL = 1; then
+    gl_REPLACE_POLL_H
     AC_LIBOBJ([poll])
-    AC_DEFINE([poll], [rpl_poll],
-      [Define to poll if the replacement function should be used.])
     gl_PREREQ_POLL
-    POLL_H=poll.h
+  else
+    AC_DEFINE([HAVE_POLL], [1],
+      [Define to 1 if you have the 'poll' function and it works.])
   fi
-  AC_SUBST([POLL_H])
 ])
 
 # Prerequisites of lib/poll.c.