[libvirt] [PATCH] build: fix VPATH builds

Eric Blake eblake at redhat.com
Mon Jul 26 16:42:45 UTC 2010

After the recent libvirt-qemu library addition, VPATH builds fail with:

  CC     libvirt_qemu_la-libvirt-qemu.lo
In file included from ../../src/libvirt-qemu.c:29:
../../include/libvirt/libvirt-qemu.h:17:22: error: libvirt.h: No such file or directory
  CCLD   libvirt-qmeu.la
/usr/bin/ld: cannot open linker script file libvirt_qemu.syms: No such file or directory

This fixes both issues (there are still some documentation VPATH issues,
but those don't show up with 'make all').

* configure.ac (LIBVIRT_QEMU_SYMBOL_FILE): While libvirt.syms is
generated and lives in $(builddir), libvirt_qemu.syms is static
and lives in $(srcdir).
* include/libvirt/libvirt-qemu.h (includes): Pull in libvirt.h via
the public location, since this is a public header.

Tested with both in-tree and VPATH builds.

Should libvirt-qemu.h be using <libvirt/libvirt.h> instead of

 configure.ac                   |    2 +-
 include/libvirt/libvirt-qemu.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 08b7eb6..98d2f6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1833,7 +1833,7 @@ CYGWIN_EXTRA_PYTHON_LIBADD=
 case "$host" in
diff --git a/include/libvirt/libvirt-qemu.h b/include/libvirt/libvirt-qemu.h
index d21fd92..9c191c7 100644
--- a/include/libvirt/libvirt-qemu.h
+++ b/include/libvirt/libvirt-qemu.h
@@ -14,7 +14,7 @@
 #ifndef __VIR_QEMU_H__
 # define __VIR_QEMU_H__

-# include "libvirt.h"
+# include "libvirt/libvirt.h"

 # ifdef __cplusplus
 extern "C" {

More information about the libvir-list mailing list