Re: [PATCH] docs: apibuild: Fix VPATH build

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

 



On Fri, 2016-04-22 at 16:21 +0200, Peter Krempa wrote:
> libvirt-common.h is generated into builddir/include/libvirt. apibuild.py
> only operated on srcdir/inlcude/libvirt. With VPATH build
> srcdir/docs/libvirt-libvirt-common.html would not get generated and make
> RPM failed.
> ---
> We still generate the html files and other stuff into the srcdir which is gross,
> but's that for a different fix.

/me nods in emphatic agreement

>  docs/Makefile.am | 2 +-
>  docs/apibuild.py | 7 ++++++-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/docs/Makefile.am b/docs/Makefile.am
> index 3ca53a4..1b21b5c 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 8882759..648036f 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, [])

ACK

-- 
Andrea Bolognani
Software Engineer - Virtualization Team

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]