[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 14/17] libxl: only include utmp.h if it's present



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@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/config.h.in              |    3 +++
 tools/configure.ac             |    2 +-
 tools/libxl/libxl_bootloader.c |    2 ++
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/config.h.in b/tools/config.h.in
index 015f2a1..e29985d 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -51,6 +51,9 @@
 /* Define to 1 if you have the <yajl/yajl_version.h> header file. */
 #undef HAVE_YAJL_YAJL_VERSION_H
 
+/* Define to 1 if you have the <utmp.h> header file. */
+#undef HAVE_UTMP_H
+
 /* Define curses header to use */
 #undef INCLUDE_CURSES_H
 
diff --git a/tools/configure.ac b/tools/configure.ac
index 9dcfe81..61e19ac 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -267,7 +267,7 @@ AC_CHECK_LIB([fdt], [fdt_create], [], [AC_MSG_ERROR([Could 
not find libfdt])])
 esac
 
 # Checks for header files.
-AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
+AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h utmp.h])
 
 AC_OUTPUT()
 
diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 3287bf7..c3ec782 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -15,7 +15,9 @@
 #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
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.