Link against libutil when checking poll

This commit is contained in:
Quentin Smith
2012-04-20 11:01:14 -04:00
parent dd49b986ed
commit 46ec3b4145
+8 -5
View File
@@ -240,6 +240,11 @@ PKG_CHECK_MODULES([TINFO], [tinfo], ,
AC_SUBST([TINFO_LIBS], ["$TINFO_LDFLAGS -lncurses"])],
[AC_MSG_ERROR([Unable to find libtinfo or libncurses])])])])])
AC_CHECK_DECL([forkpty],
[AC_DEFINE([FORKPTY_IN_LIBUTIL], [1],
[Define if libutil.h necessary for forkpty().])],
, [[#include <libutil.h>]])
AC_ARG_VAR([poll_CFLAGS], [C compiler flags for poll])
AC_ARG_VAR([poll_LIBS], [linker flags for poll])
AS_IF([test -z "$poll_LIBS"], [
@@ -259,6 +264,9 @@ AC_CACHE_CHECK([whether poll can handle ptys],
AS_IF([test "x$poll_LIBS" != "x"],
[LIBS="$LIBS $poll_LIBS"])
AS_IF([test "x$FORKPTY_IN_LIBUTIL" != "x"],
[LIBS="$LIBS -lutil"])
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <unistd.h>
#include <stdio.h>
@@ -318,11 +326,6 @@ AC_CHECK_DECL([mach_absolute_time],
[Define if mach_absolute_time is available.])],
, [[#include <mach/mach_time.h>]])
AC_CHECK_DECL([forkpty],
[AC_DEFINE([FORKPTY_IN_LIBUTIL], [1],
[Define if libutil.h necessary for forkpty().])],
, [[#include <libutil.h>]])
AC_CHECK_DECL([htobe64],
[AC_DEFINE([HAVE_HTOBE64], [1],
[Define if htobe64 and friends exist.])],