Skip to content

Commit

Permalink
Link against libutil when checking poll
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinmit committed Apr 20, 2012
1 parent dd49b98 commit 46ec3b4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions configure.ac
Expand Up @@ -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"], [
Expand All @@ -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>
Expand Down Expand Up @@ -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.])],
Expand Down

0 comments on commit 46ec3b4

Please sign in to comment.