3 # Copyright (C) 1996, 1999, 2001, 2004, 2009-2020 Free Software Foundation,
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 AC_DEFUN([gl_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
10 [AC_REQUIRE([gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
11 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
12 [gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h],
13 [gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
15 if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no; then
17 [#include <sys/types.h>
18 # include <sys/ioctl.h>
22 ], [gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes])
25 if test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
26 AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1],
27 [Define if your system defines TIOCGWINSZ in sys/ioctl.h.])