3 # Copyright (C) 1996, 1999, 2001-2002, 2004, 2006, 2009-2010 Free Software
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 dnl From Jim Meyering and Paul Eggert.
10 AC_DEFUN([gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
11 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
12 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
13 gl_cv_sys_tiocgwinsz_needs_termios_h,
14 [gl_cv_sys_tiocgwinsz_needs_termios_h=no
16 if test $ac_cv_sys_posix_termios = yes; then
18 [#include <sys/types.h>
23 ], gl_cv_sys_tiocgwinsz_needs_termios_h=yes)
28 AC_DEFUN([gl_WINSIZE_IN_PTEM],
29 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
30 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
31 gl_cv_sys_struct_winsize_needs_sys_ptem_h,
32 [gl_cv_sys_struct_winsize_needs_sys_ptem_h=yes
33 if test $ac_cv_sys_posix_termios = yes; then
34 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <termios.h>]],
36 if (sizeof x > 0) return 0;]])],
37 [gl_cv_sys_struct_winsize_needs_sys_ptem_h=no])
39 if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
40 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/ptem.h>]],
42 if (sizeof x > 0) return 0;]])],
43 [], [gl_cv_sys_struct_winsize_needs_sys_ptem_h=no])
45 if test $gl_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
46 AC_DEFINE([WINSIZE_IN_PTEM], [1],
47 [Define if sys/ptem.h is required for struct winsize.])