All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-users@lists.xen.org" <xen-users@lists.xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Giorgio Mossa <mossa@poisson.phc.unipi.it>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: libutil.h moved to bsd/libutil.h (Was: Re: [Xen-users] Problem compiling Xen 4.2 from sources)
Date: Wed, 3 Oct 2012 10:31:57 +0200	[thread overview]
Message-ID: <506BF7FD.4000707@citrix.com> (raw)
In-Reply-To: <1349196417.650.115.camel@zakaz.uk.xensource.com>

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@citrix.com>
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@citrix.com>
---
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 @@
 AC_DEFUN([AX_CHECK_PTYFUNCS], [
+    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.
+    AX_SAVEVAR_SAVE(CPPFLAGS)
+    CPPFLAGS="$CPPFLAGS -Werror"
     AC_CHECK_HEADER([libutil.h],[
       AC_DEFINE([INCLUDE_LIBUTIL_H],[<libutil.h>],[libutil header file name])
     ])
+    AX_SAVEVAR_RESTORE(CPPFLAGS)
     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
-- 
1.7.7.5 (Apple Git-26)

  parent reply	other threads:[~2012-10-03  8:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20121002163136.GA5378@intersect>
2012-10-02 16:46 ` libutil.h moved to bsd/libutil.h (Was: Re: [Xen-users] Problem compiling Xen 4.2 from sources) Ian Campbell
2012-10-02 16:50   ` [Xen-users] libutil.h moved to bsd/libutil.h (Was: " Ian Campbell
2012-10-02 19:54     ` Giorgio Mossa
2012-10-03  8:31   ` Roger Pau Monné [this message]
2012-10-03 10:01     ` libutil.h moved to bsd/libutil.h (Was: Re: [Xen-users] " Giorgio Mossa
2012-10-08 11:19     ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=506BF7FD.4000707@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=mossa@poisson.phc.unipi.it \
    --cc=xen-devel@lists.xen.org \
    --cc=xen-users@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.