FreeBSD needs libutil.h for forkpty()

The header is not available everywhere, so only include it if it
is present.  (The extra include should be harmless on Linux by
inspection.)
This commit is contained in:
Benjamin Kaduk
2012-04-05 11:15:22 -04:00
committed by Keith Winstein
parent 424e2b53e1
commit 29539516e5
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ AS_IF([test x"$with_skalibs" != xno],
# Checks for header files. # Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h curses.h fcntl.h langinfo.h limits.h locale.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/resource.h sys/socket.h sys/time.h term.h termios.h unistd.h wchar.h wctype.h], [], [AC_MSG_ERROR([Missing required header file.])]) AC_CHECK_HEADERS([arpa/inet.h curses.h fcntl.h langinfo.h limits.h locale.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/resource.h sys/socket.h sys/time.h term.h termios.h unistd.h wchar.h wctype.h], [], [AC_MSG_ERROR([Missing required header file.])])
AC_CHECK_HEADERS([pty.h util.h]) AC_CHECK_HEADERS([pty.h util.h libutil.h])
AC_CHECK_HEADERS([endian.h sys/endian.h]) AC_CHECK_HEADERS([endian.h sys/endian.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
+3
View File
@@ -20,6 +20,9 @@
#include <errno.h> #include <errno.h>
#include <locale.h> #include <locale.h>
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
#endif
#include <string.h> #include <string.h>
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>