On Mon, Jun 29, 2015 at 06:44:09PM +0200, Cédric Bosdonnat wrote:
Some linux distributions don't package static lzma library.
Allow
disabling it.
---
configure.ac | 14 +++++++++++++-
libvirt-sandbox/libvirt-sandbox-init-qemu.c | 12 ++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 140fb8c..834a444 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,7 +81,14 @@ PKG_CHECK_MODULES(LIBVIRT_GLIB, libvirt-glib-1.0 >=
$LIBVIRT_GOBJECT_REQUIRED)
PKG_CHECK_MODULES(LIBVIRT_GOBJECT, libvirt-gobject-1.0 >= $LIBVIRT_GOBJECT_REQUIRED)
PKG_CHECK_MODULES(LIBVIRT_GCONFIG, libvirt-gconfig-1.0 >= $LIBVIRT_GCONFIG_REQUIRED)
PKG_CHECK_MODULES(ZLIB, zlib >= $ZLIB_REQUIRED)
-PKG_CHECK_MODULES(LZMA, liblzma >= $LZMA_REQUIRED)
+AC_ARG_WITH([lzma],
+ [AS_HELP_STRING([--with-lzma],
+ [add LZMA support @<:@default=yes@:>@])])
+m4_divert_text([DEFAULTS], [with_lzma=yes])
+
+if test "$with_lzma" = "yes" ; then
+ PKG_CHECK_MODULES(LZMA, liblzma >= $LZMA_REQUIRED)
Needs an AC_DEFINE() to get WITH_LZMA in config.h
diff --git a/libvirt-sandbox/libvirt-sandbox-init-qemu.c
b/libvirt-sandbox/libvirt-sandbox-init-qemu.c
index eabf9aa..a9e6263 100644
--- a/libvirt-sandbox/libvirt-sandbox-init-qemu.c
+++ b/libvirt-sandbox/libvirt-sandbox-init-qemu.c
@@ -42,7 +42,9 @@
#include <fcntl.h>
#include <sys/reboot.h>
#include <termios.h>
+#if WITH_LZMA
#include <lzma.h>
+#endif /* WITH_LZMA */
To make this work.
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|