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

Re: [Xen-users] libutil.h moved to bsd/libutil.h (Was: Re: Problem compiling Xen 4.2 from sources)

On 02/10/12 18:46, Ian Campbell wrote:
> (Adding some CCs)
> On Tue, 2012-10-02 at 17:31 +0100, Giorgio Mossa wrote:
>> Hello everyone,
>> I'm working on an Ubuntu 12.04 and I wanted to test
>> Xen 4.2 (official repository offer just version 4.1),
>> so I've downloaded the source tarball from the site,
>> followed the instruction in the readme but when compiling
>> I'm getting the following error:
>>  In file included from libxl_bootloader.c:21:0:
>>  /usr/include/libutil.h:33:2: error: #warning "Deprecated header, use 
>> <bsd/libutil.h> or libbsd-overlay.pc instead." [-Werror=cpp]
>>  cc1: all warnings being treated as errors
>>  make[3]: *** [libxl_bootloader.o] Error 1
>> could anyone explain how to solve this problem, without disabling the 
>> warning/errors compilation options?
> Looks like someone has decided to move this header from /usr/include
> to /usr/include/bsd and leave behind a #warning in the old location,
> which has broken the way we do things.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640895 seems to relate
> to the fallout from this.
> I'm not sure when the include of libutil is needed, it's not mentioned
> in the Linux man pages and on Linux neither of the functions we purport
> to need from it are actually present. Perhaps it's a BSD only thing?
> Probably we need to check for bsd/libutil.h in preference to libutil.h
> although the resolution of #640895 suggests that what we do now is
> correct now that the bug is fixed, in which case a bug against Ubuntu
> would be appropriate.
> Ian, Royer, What do you guys think?

According to the man pages <libutil.h> is only needed on BSDs to be able
to use openpty et al. Linux should not have this file, could you please
try the following patch? It should prevent configure (and thus libxl)
from including the bogus libutil.h header.

>From 250c0d533bab3c9705ade8e4bffed54abcb53b1c Mon Sep 17 00:00:00 2001
From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
Date: Wed, 3 Oct 2012 10:22:21 +0200
Subject: [PATCH] autoconf: add -Werror to libutil.h header check

libutil.h is only needed on BSDs, but not in Linux. Debian package
libbsd-dev-0.3.0-1 installed a libutil.h overlay that contains a
#warning, thus making libxl compilation broken due to -Werror.

Perform the libutil.h check with -Werror, so we don't include this
bogus header.

Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxx>
Please rerun autoconf after applying this patch
 tools/m4/ptyfuncs.m4 |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/m4/ptyfuncs.m4 b/tools/m4/ptyfuncs.m4
index bfea3e1..3e37b5a 100644
--- a/tools/m4/ptyfuncs.m4
+++ b/tools/m4/ptyfuncs.m4
@@ -1,7 +1,14 @@
+    dnl This is a workaround for a bug in Debian package
+    dnl libbsd-dev-0.3.0-1. Once we no longer support that
+    dnl package we can remove the addition of -Werror to
+    dnl CPPFLAGS.
       AC_DEFINE([INCLUDE_LIBUTIL_H],[<libutil.h>],[libutil header file name])
     AC_CACHE_CHECK([for openpty et al], [ax_cv_ptyfuncs_libs], [
         for ax_cv_ptyfuncs_libs in -lutil "" NOT_FOUND; do
             if test "x$ax_cv_ptyfuncs_libs" = "xNOT_FOUND"; then
-- (Apple Git-26)

Xen-users mailing list



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