3 # Copyright (C) 1996, 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
8 dnl From Jim Meyering and Paul Eggert.
9 AC_DEFUN([gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
10 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
11 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
12 jm_cv_sys_tiocgwinsz_needs_termios_h,
13 [jm_cv_sys_tiocgwinsz_needs_termios_h=no
15 if test $ac_cv_sys_posix_termios = yes; then
17 [#include <sys/types.h>
22 ], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
27 AC_DEFUN([gl_WINSIZE_IN_PTEM],
28 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
29 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
30 jm_cv_sys_struct_winsize_needs_sys_ptem_h,
31 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
32 if test $ac_cv_sys_posix_termios = yes; then
33 AC_TRY_COMPILE([#include <termios.h>]
35 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
37 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
38 AC_TRY_COMPILE([#include <sys/ptem.h>],
40 [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
42 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
43 AC_DEFINE([WINSIZE_IN_PTEM], 1,
44 [Define if sys/ptem.h is required for struct winsize.])