*** empty log message ***
[coreutils.git] / m4 / jm-winsz2.m4
blob642e1ff1459c73076791367ebe399fe174c578a0
1 #serial 2
3 AC_DEFUN(jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
4 [AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
5  AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
6                 jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
7   [jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
9   if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
10     AC_EGREP_CPP([yes],
11     [#include <sys/types.h>
12 #     include <sys/ioctl.h>
13 #     ifdef TIOCGWINSZ
14         yes
15 #     endif
16     ], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
17   fi
18   ])
19   if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
20     AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
21   fi