Laszlo Ersek
2021-Sep-06 11:43 UTC
[Libguestfs] [guestfs-tools PATCH 0/3] build against locally built libguestfs
This series (in combination with the sibling series for libguestfs-common) allows guestfs-tools to be built against a just-built libguestfs (e.g. with the libguest-devel package absent), using the commands $ git submodule update --init --force $ autoreconf -i $ ../libguestfs/run ./configure CFLAGS=-fPIC $ ../libguestfs/run make -j $(getconf _NPROCESSORS_ONLN) $ ../libguestfs/run make -j $(getconf _NPROCESSORS_ONLN) check Thanks, Laszlo Laszlo Ersek (3): Makefile.am: fix $(LIBGUESTFS_CFLAGS) typo for virt-ls Makefile.am: supply missing $(LIBGUESTFS_CFLAGS) Makefile.am: use $(LIBGUESTFS_LIBS) for linking OCaml programs builder/Makefile.am | 5 ++++- cat/Makefile.am | 2 +- customize/Makefile.am | 2 ++ dib/Makefile.am | 1 + get-kernel/Makefile.am | 1 + resize/Makefile.am | 1 + sparsify/Makefile.am | 1 + sysprep/Makefile.am | 1 + 8 files changed, 12 insertions(+), 2 deletions(-) base-commit: 9ba463545fa017910a5077434f87ae67e146c9e0 -- 2.19.1.3.g30247aa5d201
Laszlo Ersek
2021-Sep-06 11:43 UTC
[Libguestfs] [guestfs-tools PATCH 1/3] Makefile.am: fix $(LIBGUESTFS_CFLAGS) typo for virt-ls
Commit 4354a3126152 ("Add build system.", 2021-03-11) added $(LIBGUESTFS_LIBS) to "virt_ls_CFLAGS" and "virt_ls_LDADD" both. Correct the former; it should carry $(LIBGUESTFS_CFLAGS). Currently, the command> $ ../libguestfs/run makeproduces the error> CC virt_ls-ls.o > ls.c:47:10: fatal error: guestfs.h: No such file or directory > 47 | #include "guestfs.h" > | ^~~~~~~~~~~Fixes: 4354a3126152a2748cc9097cba139b3908ccc342 Signed-off-by: Laszlo Ersek <lersek at redhat.com> --- cat/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cat/Makefile.am b/cat/Makefile.am index 39d0d25576eb..f1de5c866987 100644 --- a/cat/Makefile.am +++ b/cat/Makefile.am @@ -138,9 +138,9 @@ virt_ls_CPPFLAGS = \ virt_ls_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ $(LIBXML2_CFLAGS) \ - $(LIBGUESTFS_LIBS) + $(LIBGUESTFS_CFLAGS) virt_ls_LDADD = \ $(top_builddir)/common/options/liboptions.la \ $(top_builddir)/common/visit/libvisit.la \ -- 2.19.1.3.g30247aa5d201
Laszlo Ersek
2021-Sep-06 11:43 UTC
[Libguestfs] [guestfs-tools PATCH 2/3] Makefile.am: supply missing $(LIBGUESTFS_CFLAGS)
Common C source code pulled into virt-builder, virt-index-validate and virt-customize #includes "guestfs.h", but the guestfs-tools makefiles of those modules do not add $(LIBGUESTFS_CFLAGS) to the respective module CFLAGS macros. The command> $ ../libguestfs/run makeproduces errors such as> CC ../common/edit/libcustomize_a-file-edit.o > In file included from ../common/edit/file-edit.c:46: > ../common/edit/file-edit.h:22:10: fatal error: guestfs.h: No such file or directory > 22 | #include <guestfs.h> > | ^~~~~~~~~~~Add the missing $(LIBGUESTFS_CFLAGS) instances. Signed-off-by: Laszlo Ersek <lersek at redhat.com> --- builder/Makefile.am | 4 +++- customize/Makefile.am | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/builder/Makefile.am b/builder/Makefile.am index f49a3b0aaa12..9c155c7f29ef 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -148,8 +148,9 @@ virt_builder_CPPFLAGS = \ virt_builder_CFLAGS = \ -pthread \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ -Wno-unused-macros \ + $(LIBGUESTFS_CFLAGS) \ $(LIBLZMA_CFLAGS) \ $(LIBTINFO_CFLAGS) \ $(LIBXML2_CFLAGS) @@ -446,9 +447,10 @@ virt_index_validate_CPPFLAGS = \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/include virt_index_validate_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ - -Wno-unused-macros + -Wno-unused-macros \ + $(LIBGUESTFS_CFLAGS) virt_index_validate_LDADD = \ $(LTLIBINTL) \ ../gnulib/lib/libgnu.la diff --git a/customize/Makefile.am b/customize/Makefile.am index d3f07d723c4a..7bf6af444b67 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -102,8 +102,9 @@ libcustomize_a_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common/edit libcustomize_a_CFLAGS = \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(LIBGUESTFS_CFLAGS) \ $(LIBCRYPT_CFLAGS) \ $(LIBVIRT_CFLAGS) \ $(LIBXML2_CFLAGS) \ -fPIC -- 2.19.1.3.g30247aa5d201
Laszlo Ersek
2021-Sep-06 11:43 UTC
[Libguestfs] [guestfs-tools PATCH 3/3] Makefile.am: use $(LIBGUESTFS_LIBS) for linking OCaml programs
Otherwise the command> $ ../libguestfs/run makeproduces errors like> GEN virt-customize > /usr/bin/ld: cannot find -lguestfs > /usr/bin/ld: cannot find -lguestfs > collect2: error: ld returned 1 exit status > File "caml_startup", line 1: > Error: Error during linking (exit code 1)in the "builder", "customize", "dib", "get-kernel", "resize", "sparsify" and "sysprep" modules. Signed-off-by: Laszlo Ersek <lersek at redhat.com> --- builder/Makefile.am | 1 + customize/Makefile.am | 1 + dib/Makefile.am | 1 + get-kernel/Makefile.am | 1 + resize/Makefile.am | 1 + sparsify/Makefile.am | 1 + sysprep/Makefile.am | 1 + 7 files changed, 7 insertions(+) diff --git a/builder/Makefile.am b/builder/Makefile.am index 9c155c7f29ef..78274426aec5 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -200,8 +200,9 @@ OCAMLCLIBS = \ -pthread -lpthread \ -lutils \ $(LIBTINFO_LIBS) \ $(LIBCRYPT_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBLZMA_LIBS) \ $(LIBXML2_LIBS) \ $(JANSSON_LIBS) \ $(LIBINTL) \ diff --git a/customize/Makefile.am b/customize/Makefile.am index 7bf6af444b67..6bdd5fae91e6 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -168,8 +168,9 @@ OCAMLLINKFLAGS = \ OCAMLCLIBS = \ -pthread -lpthread \ -lutils \ $(LIBTINFO_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBCRYPT_LIBS) \ $(LIBVIRT_LIBS) \ $(LIBXML2_LIBS) \ $(LIBINTL) \ diff --git a/dib/Makefile.am b/dib/Makefile.am index f607449f249a..7581feb787ec 100644 --- a/dib/Makefile.am +++ b/dib/Makefile.am @@ -91,8 +91,9 @@ endif OCAMLCLIBS = \ -pthread -lpthread \ -lutils \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' diff --git a/get-kernel/Makefile.am b/get-kernel/Makefile.am index e0df00ec06a7..c81cb8ba8cb4 100644 --- a/get-kernel/Makefile.am +++ b/get-kernel/Makefile.am @@ -73,8 +73,9 @@ endif OCAMLCLIBS = \ -pthread -lpthread \ -lutils \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' diff --git a/resize/Makefile.am b/resize/Makefile.am index 606fcecb6ebc..f8aa4c46bfcf 100644 --- a/resize/Makefile.am +++ b/resize/Makefile.am @@ -73,8 +73,9 @@ OCAMLCLIBS = \ -lprogress \ -lutils \ $(LIBTINFO_LIBS) \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am index d5c8cd3367ae..0eca849da46b 100644 --- a/sparsify/Makefile.am +++ b/sparsify/Makefile.am @@ -80,8 +80,9 @@ OCAMLCLIBS = \ -lprogress \ -lutils \ $(LIBTINFO_LIBS) \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am index d32ab20e57e9..e213244bc17a 100644 --- a/sysprep/Makefile.am +++ b/sysprep/Makefile.am @@ -131,8 +131,9 @@ OCAMLCLIBS = \ -lutils \ $(LIBTINFO_LIBS) \ $(LIBCRYPT_LIBS) \ $(LIBXML2_LIBS) \ + $(LIBGUESTFS_LIBS) \ $(LIBINTL) \ -lgnu OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)' -- 2.19.1.3.g30247aa5d201