diff --git a/docs/Makefile.am b/docs/Makefile.am index 3ca53a492e453ee008cfd1dbc37205f065f001c3..1b21b5c2fc6f3ee136134e362226bd46b25bdc54 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -325,7 +325,7 @@ $(APIBUILD_STAMP): $(srcdir)/apibuild.py \ $(top_srcdir)/src/util/virerror.c \ $(top_srcdir)/src/util/virevent.c \ $(top_srcdir)/src/util/virtypedparam.c - $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(APIBUILD) + $(AM_V_GEN)srcdir=$(srcdir) builddir=$(abs_builddir) $(PYTHON) $(APIBUILD) touch $@ diff --git a/docs/apibuild.py b/docs/apibuild.py index 888275900b4c1b9f4d490c7e3463ad6d7316adf2..648036ff58f7285c4faf2360b172f2646e193c9e 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -2584,13 +2584,18 @@ def rebuild(name): self.warning("rebuild() failed, unknown module %s") % name return None builder = None - srcdir = os.environ["srcdir"] + srcdir = os.path.abspath((os.environ["srcdir"])) + builddir = os.path.abspath((os.environ["builddir"])) + if srcdir == builddir: + builddir = None if glob.glob(srcdir + "/../src/libvirt.c") != [] : if not quiet: print "Rebuilding API description for %s" % name dirs = [srcdir + "/../src", srcdir + "/../src/util", srcdir + "/../include/libvirt"] + if builddir: + dirs.append(builddir + "/../include/libvirt") if glob.glob(srcdir + "/../include/libvirt/libvirt.h") == [] : dirs.append("../include/libvirt") builder = docBuilder(name, srcdir, dirs, [])