PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/config/ac_pollselect.m4

https://code.google.com/
m4 | 32 lines | 16 code | 1 blank | 15 comment | 0 complexity | 6cfdf15afd0803719e0aea4d13d5d58f MD5 | raw file
 1##*****************************************************************************
 2## $Id$
 3##*****************************************************************************
 4#  AUTHOR:
 5#    Albert Chu <chu11@llnl.gov> 
 6#
 7#  SYNOPSIS:
 8#    AC_POLLSELECT
 9#
10#  DESCRIPTION:
11#    Checks for poll() and select() and determines which to use.
12#
13#  WARNINGS:
14#    This macro must be placed after AC_PROG_CC or equivalent.
15##*****************************************************************************
16
17AC_DEFUN([AC_POLLSELECT],
18[
19   AC_CHECK_FUNC([poll], [ac_have_poll=yes], [ac_have_poll=no])
20   if test "$ac_have_poll" = "yes" ; then
21      AC_DEFINE([HAVE_POLL], [1], [Define that you will use poll()])
22   else
23      AC_CHECK_FUNC([select], [ac_have_select=yes], [ac_have_select=no])
24      if test "$ac_have_select" = "yes" ; then
25         AC_MSG_WARN([System does not support poll(), default to select()])
26         AC_DEFINE([HAVE_SELECT], [1], [Define that you will use select()])
27     else 
28         AC_MSG_ERROR([System does not support select() or poll(),
29                       get a real operating system!!!])
30     fi
31   fi
32])