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

Re: [Xen-devel] [PATCH v2 3/4] python: set absolute path to libxl.h on _pyxl_types.c



Ian Campbell wrote:
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.

Actually I'm not sure if it's possible to make sure the in-tree -I lines come first, because the gcc options are automatically generated by python build tools (distutils & friends...), so we cannot touch much of this (I've looked at distutils.core options, and it seems to be no way of setting an order on compiler options, but I'm no expert on python C extensions building), so unless we craft our own makefile to build this python stuff I think we are stuck with something like this.


Cc: Ian Jackson<ian.jackson@xxxxxxxxxx>
Cc: Christoph Egger<Christoph.Egger@xxxxxxx>
Signed-off-by: Roger Pau Monne<roger.pau@xxxxxxxxxx>
---
  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<stdint.h>
  #include<stdlib.h>
  #include<stdio.h>
-#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




_______________________________________________
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®.