build: Allow C programs using libguestfs to be compiled against build dir.

We use a similar trick to libvirt to allow external C programs that
use libguestfs to be compiled against the built (but not installed)
libguestfs with:

  ../libguestfs/run ./configure
  make

What actually happens is we have a second pkg-config file
(lib/local/libguestfs.pc) which points to the locally built
libguestfs.  The ./run script sets up PKG_CONFIG_PATH to point to this
directory.  Assuming that ./configure is using pkg-config/pkgconf and
not some other half-baked solution it will pick up the libguestfs.pc
file from here which will set CFLAGS and LIBS appropriately.
This commit is contained in:
Richard W.M. Jones
2020-03-10 14:36:56 +00:00
parent b45b7cc08f
commit e33b3c83a0
6 changed files with 45 additions and 1 deletions

1
.gitignore vendored
View File

@@ -337,6 +337,7 @@ Makefile.in
/lib/libguestfs.syms
/lib/.libs/libguestfs.so
/lib/libvirt-is-version
/lib/local/libguestfs.pc
/lib/stamp-guestfs.pod
/lib/structs-compare.c
/lib/structs-copy.c