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 make

produces 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 <[email protected]>
---
 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


_______________________________________________
Libguestfs mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to