diff options
author | Quentin Smith <quentin@mit.edu> | 2012-04-20 11:01:14 -0400 |
---|---|---|
committer | Quentin Smith <quentin@mit.edu> | 2012-04-20 11:01:14 -0400 |
commit | 46ec3b41450c1f388d7e48d6458237e3a3fef208 (patch) | |
tree | 551e83829ca58b6d528e933b1a431a4239cb3322 | |
parent | dd49b986ed3612910ae75d10cf78411bef361b2d (diff) |
Link against libutil when checking poll
-rw-r--r-- | configure.ac | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 246eeaa..e9d08d8 100644 --- a/configure.ac +++ b/configure.ac @@ -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.])], |