diff --git a/scripts/configure.in b/scripts/configure.in index 1b4f7cfb..7f76db27 100644 --- a/scripts/configure.in +++ b/scripts/configure.in @@ -170,6 +170,15 @@ dnl Check for AC_CHECK_HEADERS(sys/time.h) AC_HEADER_TIME +dnl Check for +AC_CHECK_HEADERS(termio.h) + +dnl Check for +AC_CHECK_HEADERS(termios.h) + +dnl Check for +AC_CHECK_HEADERS(sys/ioctl.h) + dnl Check for va_copy AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy, AC_TRY_LINK( diff --git a/utils/magsgtty.h b/utils/magsgtty.h index 76f7ddf5..298aaf8e 100644 --- a/utils/magsgtty.h +++ b/utils/magsgtty.h @@ -21,6 +21,7 @@ #ifndef _MAGIC__UTILS__MAGSGTTY_H #define _MAGIC__UTILS__MAGSGTTY_H +/* maybe this can be #ifndef HAVE_TERMIO_H */ #if !defined(SYSV) && !defined(CYGWIN) # ifdef ALPHA @@ -28,15 +29,25 @@ # undef MIN # endif +/* unclear what platform requires this OpenBSD/FreeBSD ? */ # ifndef COMPAT_43TTY # define COMPAT_43TTY # endif +#ifdef HAVE_SYS_IOCTL_H #include +#endif -#if defined(__OpenBSD__) || defined(EMSCRIPTEN) +#ifdef HAVE_TERMIOS_H #include #else +/* unclear which platform(s) require and the structure + * of this file is such that it will try to include it by default, better + * to invert the #if and only select this on the known platforms that need + * it so that goes by default, which exists on MacOSX, Linux, etc.. + * many possible solutions to make this work by default: + * HAVE_SYS_IOCTL_COMPAT_H ? HAVE_TERMIOS_H ? !defined(linux) at top (MaxOSX is BSD type) + */ #include #endif