[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/2] shouldn't fail to build if you leave out --with-{zlib, lzma}



These dependencies are optional but default to enabled, so if you
shouldn't have to explicitly have to mention them when you run
configure.
---
 configure.ac | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8a34620..580bbf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,27 +83,28 @@ 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)
 
-AC_ARG_WITH([zlib],
-  [AS_HELP_STRING([--with-zlib],
-    [add ZLIB support @<:@default=yes@:>@])])
-m4_divert_text([DEFAULTS], [with_zlib=yes])
-
 orig_pkg_config="$PKG_CONFIG"
 PKG_CONFIG="$PKG_CONFIG --static"
-if test "$with_zlib" = "yes" ; then
-    PKG_CHECK_MODULES(ZLIB, zlib >= $ZLIB_REQUIRED)
-    AC_DEFINE([WITH_ZLIB], [1], [Whether ZLIB support was enabled])
-fi
+
+AC_ARG_WITH([zlib],
+            [AS_HELP_STRING([--with-zlib],
+                            [add ZLIB support @<:@default=yes@:>@])])
+m4_divert_text([DEFAULTS], [with_zlib=yes])
+ZLIB_CFLAGS=
+ZLIB_LIBS=
+AM_CONDITIONAL([WITH_ZLIB], [test "x$with_zlib" != "xno"])
+AM_COND_IF([WITH_ZLIB],
+           [PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])])
 
 AC_ARG_WITH([lzma],
-  [AS_HELP_STRING([--with-lzma],
-    [add LZMA support @<:@default=yes@:>@])])
+            [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)
-    AC_DEFINE([WITH_LZMA], [1], [Whether LZMA support was enabled])
-fi
+LZMA_CFLAGS=
+LZMA_LIBS=
+AM_CONDITIONAL([WITH_LZMA], [test "x$with_lzma" != "xno"])
+AM_COND_IF([WITH_LZMA],
+           [PKG_CHECK_MODULES([LZMA], [liblzma >= $LZMA_REQUIRED])])
 PKG_CONFIG="$orig_pkg_config"
 
 LIBVIRT_SANDBOX_CAPNG
-- 
2.5.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]