dnl CF_TERMIO_AND_CURSES version: 7 updated: 2022/12/02 19:55:38
dnl --------------------
dnl Check if including termio.h with <curses.h> dies like on sysv68
dnl
dnl $1 = application header which must include <stdio.h>
dnl $2 = optional, defaulting to config.h
dnl
dnl FIXME: CPPFLAGS is Lynx-specific.
AC_DEFUN([CF_TERMIO_AND_CURSES],
[
AC_CACHE_CHECK(if we can include termio.h with curses,cf_cv_termio_and_curses,[
    cf_save_CFLAGS="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H -I. -I${srcdir:-.} -I${srcdir:-.}/src -I${srcdir:-.}/WWW/Library/Implementation"
    touch ifelse([$2],,config.h,[$2])
    AC_TRY_COMPILE([
#include <$1>
#include <termio.h>],
    [putchar(0x0a)],
    [cf_cv_termio_and_curses=yes],
    [cf_cv_termio_and_curses=no])
    CPPFLAGS="$cf_save_CFLAGS"
    rm -f ifelse([$2],,config.h,[$2])
])

test "$cf_cv_termio_and_curses" = yes && AC_DEFINE(TERMIO_AND_CURSES,1,[Define to 1 if we can include termio.h with curses.h])
])dnl
