better handling of termios header file

This commit is contained in:
Duncan Laurie 2006-03-19 21:20:42 +00:00
parent 21fb127ce2
commit 66ffa994e9
3 changed files with 21 additions and 10 deletions

View File

@ -18,7 +18,7 @@ AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
AC_CHECK_PROG([SED], [sed], [sed])
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h termios.h])
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])
@ -197,6 +197,13 @@ AC_CHECK_HEADER([linux/ipmi.h],
[Define to 1 if you have the <sys/ipmi.h> header file.])],
[echo "** Unable to find OpenIPMI header files. Using internal version."])])
dnl look for termios header file
AC_CHECK_HEADER([termios.h],
[AC_DEFINE(HAVE_TERMIOS_H, [1], [Define to 1 if you have <termios.h>.])],
[AC_CHECK_HEADER([sys/termios.h],
[AC_DEFINE(HAVE_SYS_TERMIOS_H, [1], [Define to 1 if you have <sys/termios.h>.])],
[echo "** Unable to find termios header file."])])
dnl set RPM distro tag for use in RPM name
AC_ARG_WITH([rpm-distro],
[AC_HELP_STRING([--with-rpm-distro=DISTRO],

View File

@ -42,8 +42,13 @@
#include <signal.h>
#include <unistd.h>
#include <config.h>
#if defined(HAVE_TERMIOS_H)
# include <termios.h>
#elif defined (HAVE_SYS_TERMIOS_H)
# include <sys/termios.h>
#endif
#include <ipmitool/helper.h>
#include <ipmitool/log.h>

View File

@ -49,10 +49,11 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#ifdef __linux__
#include <config.h>
#if defined(HAVE_TERMIOS_H)
# include <termios.h>
//# include <linux/termios.h>
#else
#elif defined (HAVE_SYS_TERMIOS_H)
# include <sys/termios.h>
#endif
@ -64,8 +65,6 @@
#include <ipmitool/ipmi_strings.h>
#include <ipmitool/bswap.h>
#include <config.h>
static struct timeval _start_keepalive;
static struct termios _saved_tio;
static struct winsize _saved_winsize;