From: Ian Campbell Subject: Re: [PATCH v2 3/4] python: set absolute path to libxl.h on _pyxl_types.c Date: Thu, 17 May 2012 14:25:46 +0100 Message-ID: <1337261146.7781.75.camel@zakaz.uk.xensource.com> References: <1337256990-51913-1-git-send-email-roger.pau@citrix.com> <1337256990-51913-3-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1337256990-51913-3-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: Christoph Egger , Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2012-05-17 at 13:16 +0100, Roger Pau Monne wrote: > genwrap.py generates _pyxl_types.c, which includes libxl.h, but if > libxl.h is already present in the include search path, the old one was > included instead of the new one, giving compilation errors. Since > _pyxl_types.c is generated at compilation time, we can safely set > the path to libxl.h include. > > I've only experienced this problem when compiling Xen on NetBSD with > old header files in the include path, Linux seems to not have this > problem. Should this be include <> and not "", since libxl.h isn't in the current dir in this case? Is the right fix to make sure that the in-tree -I lines come first? Ian. > > Cc: Ian Jackson > Cc: Christoph Egger > Signed-off-by: Roger Pau Monne > --- > tools/python/genwrap.py | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/python/genwrap.py b/tools/python/genwrap.py > index af8a5e9..0d7cc98 100644 > --- a/tools/python/genwrap.py > +++ b/tools/python/genwrap.py > @@ -309,10 +309,12 @@ _hidden int genwrap__defbool_set(PyObject *v, libxl_defbool *db); > #include > #include > #include > -#include "libxl.h" /* gah */ > +#include "%s" /* gah */ > #include "%s" > > -""" % tuple((' '.join(sys.argv),) + (os.path.split(decls)[-1:]),)) > +""" % tuple((' '.join(sys.argv),) + > + (os.path.dirname(sys.argv[1]) + "/libxl.h",) + > + (os.path.split(decls)[-1:]),)) > for ty in types: > if ty.private: > continue