1 dnl ---------------------------------------------------------------------------
3 dnl Copyright 2006-2009,2010 by Thomas E. Dickey
5 dnl All Rights Reserved
7 dnl Permission to use, copy, modify, and distribute this software and its
8 dnl documentation for any purpose and without fee is hereby granted,
9 dnl provided that the above copyright notice appear in all copies and that
10 dnl both that copyright notice and this permission notice appear in
11 dnl supporting documentation, and that the name of the above listed
12 dnl copyright holder(s) not be used in advertising or publicity pertaining
13 dnl to distribution of the software without specific, written prior
16 dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
17 dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18 dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
19 dnl LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20 dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
21 dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
22 dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 dnl ---------------------------------------------------------------------------
26 dnl ---------------------------------------------------------------------------
27 dnl CF_FUNC_POLL version: 4 updated: 2006/12/16 12:33:30
29 dnl See if the poll function really works. Some platforms have poll(), but
30 dnl it does not work for terminals or files.
31 AC_DEFUN([CF_FUNC_POLL],[
32 AC_CACHE_CHECK(if poll really works,cf_cv_working_poll,[
45 myfds.events = POLLIN;
47 ret = poll(&myfds, 1, 100);
48 ${cf_cv_main_return:-return}(ret != 0);
50 [cf_cv_working_poll=yes],
51 [cf_cv_working_poll=no],
52 [cf_cv_working_poll=unknown])])
53 test "$cf_cv_working_poll" = "yes" && AC_DEFINE(HAVE_WORKING_POLL, 1, [poll() works])
56 dnl ---------------------------------------------------------------------------
57 dnl CF_SIGWINCH version: 1 updated: 2006/04/02 16:41:09
59 dnl Use this macro after CF_XOPEN_SOURCE, but do not require it (not all
60 dnl programs need this test).
62 dnl This is really a MacOS X 10.4.3 workaround. Defining _POSIX_C_SOURCE
63 dnl forces SIGWINCH to be undefined (breaks xterm, ncurses). Oddly, the struct
64 dnl winsize declaration is left alone - we may revisit this if Apple choose to
65 dnl break that part of the interface as well.
66 AC_DEFUN([CF_SIGWINCH],
68 AC_CACHE_CHECK(if SIGWINCH is defined,cf_cv_define_sigwinch,[
70 #include <sys/types.h>
71 #include <sys/signal.h>
73 [cf_cv_define_sigwinch=yes],
77 #undef _POSIX_C_SOURCE
78 #include <sys/types.h>
79 #include <sys/signal.h>
81 [cf_cv_define_sigwinch=maybe],
82 [cf_cv_define_sigwinch=no])
86 if test "$cf_cv_define_sigwinch" = maybe ; then
87 AC_CACHE_CHECK(for actual SIGWINCH definition,cf_cv_fixup_sigwinch,[
88 cf_cv_fixup_sigwinch=unknown
90 while test $cf_sigwinch != 1
95 #undef _POSIX_C_SOURCE
96 #include <sys/types.h>
97 #include <sys/signal.h>
99 #if SIGWINCH != $cf_sigwinch
103 [cf_cv_fixup_sigwinch=$cf_sigwinch
106 cf_sigwinch=`expr $cf_sigwinch - 1`
110 if test "$cf_cv_fixup_sigwinch" != unknown ; then
111 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"