[libvirt] [PATCH 2/2] build: fix python in VPATH build

Eric Blake eblake at redhat.com
Tue Apr 27 21:37:55 UTC 2010


Match the fact that docs/Makefile.am dumps libvirt-api.xml in the
build dir, not the source dir.

* python/Makefile.am (API_DESC): Point make to the builddir for .xml files.
* python/generator.py (buildStubs): Output in correct location.
---

This was the only other thing getting in the way of a successful
'make syntax-check check' in a VPATH build.

 python/Makefile.am  |    4 ++--
 python/generator.py |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/python/Makefile.am b/python/Makefile.am
index eda2866..e684579 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -46,14 +46,14 @@ libvirtmod_la_LIBADD = $(mylibs) \
 	$(CYGWIN_EXTRA_LIBADD) $(CYGWIN_EXTRA_PYTHON_LIBADD)

 GENERATE = generator.py
-API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-override-api.xml
+API_DESC = ../docs/libvirt-api.xml libvirt-override-api.xml
 GENERATED= libvirt-export.c \
 	   libvirt.c \
 	   libvirt.h \
 	   libvirt.py

 generated.stamp: $(srcdir)/$(GENERATE) $(API_DESC)
-	$(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
+	$(PYTHON) $(srcdir)/$(GENERATE) .
 	touch $@

 $(GENERATED): generated.stamp
diff --git a/python/generator.py b/python/generator.py
index 6f082e8..25619bf 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -541,14 +541,14 @@ def buildStubs():
     global unknown_types

     try:
-	f = open(os.path.join(srcPref,"libvirt-api.xml"))
+	f = open("libvirt-api.xml")
 	data = f.read()
 	(parser, target)  = getparser()
 	parser.feed(data)
 	parser.close()
     except IOError, msg:
 	try:
-	    f = open(os.path.join(srcPref,"..","docs","libvirt-api.xml"))
+	    f = open(os.path.join("..","docs","libvirt-api.xml"))
 	    data = f.read()
 	    (parser, target)  = getparser()
 	    parser.feed(data)
@@ -562,7 +562,7 @@ def buildStubs():

     py_types['pythonObject'] = ('O', "pythonObject", "pythonObject", "pythonObject")
     try:
-	f = open(os.path.join(srcPref,"libvirt-override-api.xml"))
+	f = open("libvirt-override-api.xml")
 	data = f.read()
 	(parser, target)  = getparser()
 	parser.feed(data)
-- 
1.6.6.1




More information about the libvir-list mailing list