follow GNU standards
[automake.git] / m4 / winsz.m4
blob163e512bd8db8dd026e5cc53315f3240d16a2338
1 dnl From Jim Meyering.
3 # serial 1
5 AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
6 [AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
7  AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
8                 am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
9   [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
11   gwinsz_in_termios_h=no
12   if test $am_cv_sys_posix_termios = yes; then
13     AC_EGREP_CPP([yes],
14     [#include <sys/types.h>
15 #     include <termios.h>
16 #     ifdef TIOCGWINSZ
17         yes
18 #     endif
19     ], gwinsz_in_termios_h=yes)
20   fi
22   if test $gwinsz_in_termios_h = no; then
23     AC_EGREP_CPP([yes],
24     [#include <sys/types.h>
25 #     include <sys/ioctl.h>
26 #     ifdef TIOCGWINSZ
27         yes
28 #     endif
29     ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
30   fi
31   ])
32   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
33     AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
34   fi