Add a configure check for utmp.h presence, and gate the usage of
utmp.h in libxl to the result of the test.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- resolved minor conflict in configure.ac and reran autogen ]
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the <utmp.h> header file. */
+#undef HAVE_UTMP_H
+
/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
#undef HAVE_VALGRIND_MEMCHECK_H
esac
# Checks for header files.
-for ac_header in yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h
+for ac_header in yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
esac
# Checks for header files.
-AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h])
+AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h])
AC_OUTPUT()
#include "libxl_osdeps.h" /* must come before any other headers */
#include <termios.h>
+#ifdef HAVE_UTMP_H
#include <utmp.h>
+#endif
#ifdef INCLUDE_LIBUTIL_H
#include INCLUDE_LIBUTIL_H