diff --git a/.gitignore b/.gitignore index 1abb1c8b7..1ebc5421f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/common b/common index 7bcea5ce0..be42b0b8a 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 7bcea5ce0b25e93cb3bd427106fa457d3a3e96cf +Subproject commit be42b0b8a1a436483a04feb889f9f2b58bd4342e diff --git a/configure.ac b/configure.ac index 3a4d6c931..3971d30f6 100644 --- a/configure.ac +++ b/configure.ac @@ -276,6 +276,7 @@ AC_CONFIG_FILES([Makefile java/examples/Makefile lib/Makefile lib/libguestfs.pc + lib/local/libguestfs.pc lua/Makefile lua/examples/Makefile make-fs/Makefile diff --git a/lib/Makefile.am b/lib/Makefile.am index e5df96fe2..4fef46826 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -47,6 +47,7 @@ EXTRA_DIST = \ $(BUILT_SOURCES) \ MAX_PROC_NR \ libguestfs.pc.in \ + local/libguestfs.pc.in \ guestfs.pod include_HEADERS = guestfs.h diff --git a/lib/local/libguestfs.pc.in b/lib/local/libguestfs.pc.in new file mode 100644 index 000000000..129682be8 --- /dev/null +++ b/lib/local/libguestfs.pc.in @@ -0,0 +1,36 @@ +# @configure_input@ +# Copyright (C) 2020 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +# Dummy pkg-config file which is used to allow out of tree packages to +# be configured against the libguestfs tree without libguestfs needing +# to be installed. +# +# Note if you are using the ./run script then you don't need to worry +# about this because the script sets PKG_CONFIG_PATH correctly. + +prefix=@abs_top_builddir@ +exec_prefix=@abs_top_builddir@ +libdir=@abs_top_builddir@/lib/.libs +includedir=@abs_top_srcdir@/lib + +Name: libguestfs +Version: @VERSION@ +Description: libguestfs library for accessing and modifying VM images +Requires: +Cflags: -I${includedir} +Libs: -L${libdir} -lguestfs diff --git a/run.in b/run.in index c734612fc..6896d5a2c 100755 --- a/run.in +++ b/run.in @@ -223,6 +223,11 @@ export G_DEBUG=gc-friendly random_val="$(@AWK@ 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)" export MALLOC_PERTURB_=$random_val +# Allow dependent packages like virt-v2v to be compiled against +# local libguestfs. +prepend PKG_CONFIG_PATH "$b/lib/local" +export PKG_CONFIG_PATH + # Do we have libtool? If we have it then we can use it to make # running valgrind simpler. However don't depend on it. if libtool --help >/dev/null 2>&1; then