Richard W.M. Jones
2020-Mar-10 15:06 UTC
[Libguestfs] [PATCH virt-v2v] v2v: Use LIBGUESTFS_CFLAGS/LIBS when compiling and linking.
Allows virt-v2v to be compiled against the libguestfs build directory. --- v2v/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v2v/Makefile.am b/v2v/Makefile.am index 2a196d45d..104420d13 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -197,6 +197,7 @@ virt_v2v_CPPFLAGS = \ -I$(top_srcdir)/lib virt_v2v_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) \ $(LIBVIRT_CFLAGS) \ $(LIBOSINFO_CFLAGS) @@ -230,6 +231,7 @@ endif OCAMLCLIBS = \ -lqemuopts \ + $(LIBGUESTFS_LIBS) \ $(LIBVIRT_LIBS) \ $(LIBXML2_LIBS) \ $(JANSSON_LIBS) \ -- 2.24.1
Pino Toscano
2020-Mar-11 16:33 UTC
Re: [Libguestfs] [PATCH virt-v2v] v2v: Use LIBGUESTFS_CFLAGS/LIBS when compiling and linking.
On Tuesday, 10 March 2020 16:06:20 CET Richard W.M. Jones wrote:> Allows virt-v2v to be compiled against the libguestfs build directory.This is not just about building against an uninstalled libguestfs, rather about building against libguestfs no matter where it is installed (so not just in default system paths).> --- > v2v/Makefile.am | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/v2v/Makefile.am b/v2v/Makefile.am > index 2a196d45d..104420d13 100644 > --- a/v2v/Makefile.am > +++ b/v2v/Makefile.am > @@ -197,6 +197,7 @@ virt_v2v_CPPFLAGS = \ > -I$(top_srcdir)/lib > virt_v2v_CFLAGS = \ > $(WARN_CFLAGS) $(WERROR_CFLAGS) \ > + $(LIBGUESTFS_CFLAGS) \ > $(LIBVIRT_CFLAGS) \ > $(LIBOSINFO_CFLAGS) > > @@ -230,6 +231,7 @@ endif > > OCAMLCLIBS = \ > -lqemuopts \ > + $(LIBGUESTFS_LIBS) \ > $(LIBVIRT_LIBS) \ > $(LIBXML2_LIBS) \ > $(JANSSON_LIBS) \LGTM. Thanks, -- Pino Toscano
Richard W.M. Jones
2020-Mar-11 22:14 UTC
Re: [Libguestfs] [PATCH virt-v2v] v2v: Use LIBGUESTFS_CFLAGS/LIBS when compiling and linking.
On Wed, Mar 11, 2020 at 05:33:50PM +0100, Pino Toscano wrote:> On Tuesday, 10 March 2020 16:06:20 CET Richard W.M. Jones wrote: > > Allows virt-v2v to be compiled against the libguestfs build directory. > > This is not just about building against an uninstalled libguestfs, > rather about building against libguestfs no matter where it is > installed (so not just in default system paths).Yeah I think that too. It's also interesting why it happens to work now. It's because the OCaml guestfs module contains an instruction that tells ocamlopt to add ‘-lguestfs’ to the GCC link command, and we're using ocamlopt to link the final program. $ ocamlobjinfo /usr/lib64/ocaml/guestfs/mlguestfs.cmxa | grep ^Extra Extra C object files: -lmlguestfs -L../lib/.libs -lguestfs Extra C options: And even more interesting is the bogus -L option there, which is plain wrong and will need another patch to fix (it's unrelated to this fix). Rich.> > --- > > v2v/Makefile.am | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/v2v/Makefile.am b/v2v/Makefile.am > > index 2a196d45d..104420d13 100644 > > --- a/v2v/Makefile.am > > +++ b/v2v/Makefile.am > > @@ -197,6 +197,7 @@ virt_v2v_CPPFLAGS = \ > > -I$(top_srcdir)/lib > > virt_v2v_CFLAGS = \ > > $(WARN_CFLAGS) $(WERROR_CFLAGS) \ > > + $(LIBGUESTFS_CFLAGS) \ > > $(LIBVIRT_CFLAGS) \ > > $(LIBOSINFO_CFLAGS) > > > > @@ -230,6 +231,7 @@ endif > > > > OCAMLCLIBS = \ > > -lqemuopts \ > > + $(LIBGUESTFS_LIBS) \ > > $(LIBVIRT_LIBS) \ > > $(LIBXML2_LIBS) \ > > $(JANSSON_LIBS) \ > > LGTM. > > Thanks, > -- > Pino Toscano> _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Maybe Matching Threads
- Re: [PATCH virt-v2v] v2v: Use LIBGUESTFS_CFLAGS/LIBS when compiling and linking.
- [v2v PATCH 0/3] Use libosinfo for query device drivers
- [v2v PATCH v2 0/3] Use libosinfo for query device drivers
- [PATCH common] common: Use LIBGUESTFS_CFLAGS when compiling.
- [W/ commit: 838a3c9] "inconsistent assumptions over interface Guestfs"