aboutsummaryrefslogtreecommitdiffstats
path: root/tools/configure
diff options
context:
space:
mode:
authorIan Jackson <ian.jackson@eu.citrix.com>2012-05-11 18:58:57 +0100
committerIan Jackson <ian.jackson@eu.citrix.com>2012-05-11 18:58:57 +0100
commitdb1a2ddef44cf1e908b44559e383553488e026f1 (patch)
treead66d4ccebcaa73e49ba13019571e1461cfef54b /tools/configure
parent6eba329a1468c4092b7c7b4da0dc8df6acb87d30 (diff)
downloadxen-db1a2ddef44cf1e908b44559e383553488e026f1.tar.gz
xen-db1a2ddef44cf1e908b44559e383553488e026f1.tar.bz2
xen-db1a2ddef44cf1e908b44559e383553488e026f1.zip
autoconf: New test for openpty et al.
We may need to #include <libutil.h>, and/or link with -lutil, to use openpty, login_tty, and the like. Provide INCLUDE_LIBUTIL_H (preprocessor constant, not always defined) and PTYFUNCS_LIBS (makefile variable). We link libxl against PTYFUNCS_LIBS (which comes from autoconf) rather than UTIL_LIBS, and #include <libutil.h> where appropriate. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Changes since v7: * Actually include the call to AX_CHECK_PTYFUNCS in this patch, not the previous one, and regenerate configure accordingly. Changes since v6: * Put failure macro call in correct place so it might actually happen. * Try both with -lutil and without. * Patch now contains update for config.h.in. Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/configure')
-rwxr-xr-xtools/configure61
1 files changed, 61 insertions, 0 deletions
diff --git a/tools/configure b/tools/configure
index d8918fe6f2..be7feb68bd 100755
--- a/tools/configure
+++ b/tools/configure
@@ -598,6 +598,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
libiconv
+PTYFUNCS_LIBS
PTHREAD_LIBS
PTHREAD_LDFLAGS
PTHREAD_CFLAGS
@@ -2308,6 +2309,8 @@ fi
+
+
# Enable/disable options
# Check whether --enable-githttp was given.
@@ -6443,6 +6446,64 @@ $as_echo "$ax_cv_pthread_flags" >&6; }
+
+ ac_fn_c_check_header_mongrel "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default"
+if test "x$ac_cv_header_libutil_h" = x""yes; then :
+
+
+$as_echo "#define INCLUDE_LIBUTIL_H <libutil.h>" >>confdefs.h
+
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty et al" >&5
+$as_echo_n "checking for openpty et al... " >&6; }
+if test "${ax_cv_ptyfuncs_libs+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ for ax_cv_ptyfuncs_libs in -lutil "" NOT_FOUND; do
+ if test "x$ax_cv_ptyfuncs_libs" = "xNOT_FOUND"; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Unable to find library for openpty and login_tty
+See \`config.log' for more details" "$LINENO" 5 ; }
+ fi
+
+ saved_LIBS="$LIBS"
+
+ LIBS="$LIBS $ax_cv_ptyfuncs_libs"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef INCLUDE_LIBUTIL_H
+#include INCLUDE_LIBUTIL_H
+#endif
+int main(void) {
+ openpty(0,0,0,0,0);
+ login_tty(0);
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ break
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ LIBS="$saved_LIBS"
+
+ done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_ptyfuncs_libs" >&5
+$as_echo "$ax_cv_ptyfuncs_libs" >&6; }
+ PTYFUNCS_LIBS="$ax_cv_ptyfuncs_libs"
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
$as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :