[libvirt] [PATCH] build: Generate libvirt_access*.xml in source dir

Technically, these files should be generated in build dir but since docs/newapi.xsl style sheet is expecting them to be in source dir, it's much easier to put them there than trying to convince newapi.xsl to look elsewhere. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/Makefile.am | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 1388c5f..c456d48 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -863,9 +863,9 @@ ACCESS_DRIVER_SYM_FILES = \ libvirt_access_lxc.syms ACCESS_DRIVER_API_FILES = \ - libvirt_access.xml \ - libvirt_access_qemu.xml \ - libvirt_access_lxc.xml + $(srcdir)/libvirt_access.xml \ + $(srcdir)/libvirt_access_qemu.xml \ + $(srcdir)/libvirt_access_lxc.xml ACCESS_DRIVER_SOURCES = \ access/viraccessperm.h access/viraccessperm.c \ @@ -1554,15 +1554,15 @@ libvirt_access_lxc.syms: $(srcdir)/rpc/gendispatch.pl \ $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \ lxc LXC $(LXC_PROTOCOL) > $@ -libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ +$(srcdir)/libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ $(REMOTE_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ remote REMOTE $(REMOTE_PROTOCOL) > $@ -libvirt_access_qemu.xml: $(srcdir)/rpc/gendispatch.pl \ +$(srcdir)/libvirt_access_qemu.xml: $(srcdir)/rpc/gendispatch.pl \ $(QEMU_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ qemu QEMU $(QEMU_PROTOCOL) > $@ -libvirt_access_lxc.xml: $(srcdir)/rpc/gendispatch.pl \ +$(srcdir)/libvirt_access_lxc.xml: $(srcdir)/rpc/gendispatch.pl \ $(LXC_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ lxc LXC $(LXC_PROTOCOL) > $@ -- 1.8.3.2

On 09/20/2013 03:50 AM, Jiri Denemark wrote:
Technically, these files should be generated in build dir but since docs/newapi.xsl style sheet is expecting them to be in source dir, it's much easier to put them there than trying to convince newapi.xsl to look elsewhere.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/Makefile.am | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 1388c5f..c456d48 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -863,9 +863,9 @@ ACCESS_DRIVER_SYM_FILES = \ libvirt_access_lxc.syms
ACCESS_DRIVER_API_FILES = \ - libvirt_access.xml \ - libvirt_access_qemu.xml \ - libvirt_access_lxc.xml + $(srcdir)/libvirt_access.xml \ + $(srcdir)/libvirt_access_qemu.xml \ + $(srcdir)/libvirt_access_lxc.xml
I just got rid of a bunch of $(srcdir) in lists...
ACCESS_DRIVER_SOURCES = \ access/viraccessperm.h access/viraccessperm.c \ @@ -1554,15 +1554,15 @@ libvirt_access_lxc.syms: $(srcdir)/rpc/gendispatch.pl \ $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \ lxc LXC $(LXC_PROTOCOL) > $@
-libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ +$(srcdir)/libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ $(REMOTE_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ remote REMOTE $(REMOTE_PROTOCOL) > $@
...by instead hard-coding $(srcdir) into the destination. BUT that was for C files, not .xml files, so this will probably work. I'll reply again once I've run it through some tests on my end. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Sep 20, 2013 at 06:00:31AM -0600, Eric Blake wrote:
On 09/20/2013 03:50 AM, Jiri Denemark wrote:
Technically, these files should be generated in build dir but since docs/newapi.xsl style sheet is expecting them to be in source dir, it's much easier to put them there than trying to convince newapi.xsl to look elsewhere.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- src/Makefile.am | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 1388c5f..c456d48 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -863,9 +863,9 @@ ACCESS_DRIVER_SYM_FILES = \ libvirt_access_lxc.syms
ACCESS_DRIVER_API_FILES = \ - libvirt_access.xml \ - libvirt_access_qemu.xml \ - libvirt_access_lxc.xml + $(srcdir)/libvirt_access.xml \ + $(srcdir)/libvirt_access_qemu.xml \ + $(srcdir)/libvirt_access_lxc.xml
I just got rid of a bunch of $(srcdir) in lists...
ACCESS_DRIVER_SOURCES = \ access/viraccessperm.h access/viraccessperm.c \ @@ -1554,15 +1554,15 @@ libvirt_access_lxc.syms: $(srcdir)/rpc/gendispatch.pl \ $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \ lxc LXC $(LXC_PROTOCOL) > $@
-libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ +$(srcdir)/libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ $(REMOTE_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ remote REMOTE $(REMOTE_PROTOCOL) > $@
...by instead hard-coding $(srcdir) into the destination. BUT that was for C files, not .xml files, so this will probably work. I'll reply again once I've run it through some tests on my end.
It wouldn't be hard to pass either '$(builddir) or '$(srcdir)' into the XSLT processor as a parameter so it be find the files reliably. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Fri, Sep 20, 2013 at 11:50:57AM +0200, Jiri Denemark wrote:
Technically, these files should be generated in build dir but since docs/newapi.xsl style sheet is expecting them to be in source dir, it's much easier to put them there than trying to convince newapi.xsl to look elsewhere.
It isn't that hard to change newapi.xml. It should be possible todo <xsl:variable name="top_builddir">..</xsl:variable> <xsl:variable name="acls"> <xsl:copy-of select="document('$top_builddir/src/libvirt_access.xml')/aclinfo/api"/> </xsl:variable> <xsl:variable name="qemuacls"> <xsl:copy-of select="document('$top_builddir/src/libvirt_access_qemu.xml')/aclinfo/api"/> </xsl:variable> <xsl:variable name="lxcacls"> <xsl:copy-of select="document('$top_builddir/src/libvirt_access_lxc.xml')/aclinfo/api"/> </xsl:variable> And then in the Makefile.am add --stringparam top_builddir $(top_builddir) as an arg to $(XSLTPROC) Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Fri, Sep 20, 2013 at 13:16:06 +0100, Daniel Berrange wrote:
On Fri, Sep 20, 2013 at 11:50:57AM +0200, Jiri Denemark wrote:
Technically, these files should be generated in build dir but since docs/newapi.xsl style sheet is expecting them to be in source dir, it's much easier to put them there than trying to convince newapi.xsl to look elsewhere.
It isn't that hard to change newapi.xml. It should be possible todo
I didn't say it was hard. Just that it was much easier to change the makefile. Unfortunately, I have some experience with XSLT so I know it can be done and how to do it, which is why I wanted to avoid doing that :-) I guess I wasn't successful, v2 coming soon. Jirka
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Jiri Denemark