From: Roger Pau Monne Date: Mon, 2 Jun 2014 15:08:20 +0000 (+0200) Subject: libxl: only include utmp.h if it's present X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4815 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8bf33368f682e0e6b41ec7c568296f0028a175d3;p=xen.git 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é Acked-by: Ian Jackson Cc: Ian Jackson Cc: Ian Campbell [ ijc -- resolved minor conflict in configure.ac and reran autogen ] --- diff --git a/tools/config.h.in b/tools/config.h.in index 1809662597..028c360207 100644 --- a/tools/config.h.in +++ b/tools/config.h.in @@ -51,6 +51,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_UTMP_H + /* Define to 1 if you have the header file. */ #undef HAVE_VALGRIND_MEMCHECK_H diff --git a/tools/configure b/tools/configure index ea7b4de003..c3a6824f55 100755 --- a/tools/configure +++ b/tools/configure @@ -8070,7 +8070,7 @@ fi 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" diff --git a/tools/configure.ac b/tools/configure.ac index d9eab5a629..9db798b57a 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -265,7 +265,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 valgrind/memcheck.h]) +AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h]) AC_OUTPUT() diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c index 3287bf77da..c3ec782c14 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 +#ifdef HAVE_UTMP_H #include +#endif #ifdef INCLUDE_LIBUTIL_H #include INCLUDE_LIBUTIL_H