]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* configure.ac: Check for lzma.h for enabling liblzma and allow
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 11 Nov 2013 21:47:48 +0000 (22:47 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 11 Nov 2013 21:47:48 +0000 (22:47 +0100)
manual disabling.

ChangeLog
configure.ac
util/mkimage.c

index f5b008e416a0d1bd5d6b8821ba469394b998918a..2d10b7659cdc7ecda2d7d09f5a7cb5ead6e13120 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-11  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * configure.ac: Check for lzma.h for enabling liblzma and allow
+       manual disabling.
+
 2013-11-11  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Add missing includes of loader.h.
index 579acb882a914686a67c3a031184145b4a9568ba..343d5f401585c2052e06284d98cbdb666eed80fc 100644 (file)
@@ -1264,10 +1264,32 @@ fi
 
 AC_SUBST([LIBGEOM])
 
+AC_ARG_ENABLE([liblzma],
+              [AS_HELP_STRING([--enable-liblzma],
+                              [enable liblzma integration (default=guessed)])])
+if test x"$enable_liblzma" = xno ; then
+  liblzma_excuse="explicitly disabled"
+fi
+
+if test x"$liblzma_excuse" = x ; then
 AC_CHECK_LIB([lzma], [lzma_code],
-             [LIBLZMA="-llzma"
-              AC_DEFINE([HAVE_LIBLZMA], [1],
-                        [Define to 1 if you have the LZMA library.])],)
+             [],[liblzma_excuse="need lzma library"])
+fi
+if test x"$liblzma_excuse" = x ; then
+AC_CHECK_HEADER([lzma.h], [], [liblzma_excuse="need lzma header"])
+fi
+
+if test x"$enable_liblzma" = xyes && test x"$liblzma_excuse" != x ; then
+  AC_MSG_ERROR([liblzma support was explicitly requested but requirements are not satisfied])
+fi
+
+
+if test x"$liblzma_excuse" = x ; then
+   LIBLZMA="-llzma"
+   AC_DEFINE([USE_LIBLZMA], [1],
+            [Define to 1 if you have the LZMA library.])
+fi
+
 AC_SUBST([LIBLZMA])
 
 AC_ARG_ENABLE([libzfs],
@@ -1541,8 +1563,8 @@ else
   echo Build-time grub-mkfont: No "($grub_build_mkfont_excuse)"
   echo "Without unifont (no build-time grub-mkfont)"
 fi
-if test "x$LIBLZMA" = x ; then
-echo "Without liblzma (no support for XZ-compressed mips images)"
+if test x"$liblzma_excuse" != x ; then
+echo "Without liblzma (no support for XZ-compressed mips images) ($liblzma_excuse)"
 else
 echo "With liblzma from $LIBLZMA (support for XZ-compressed mips images)"
 fi
index c71f1fdcc6862424a45e19931c35dceb43828035..a5a683b98583c986e140827f86c2f0ccd796af19 100644 (file)
@@ -48,7 +48,7 @@
 
 #define ALIGN_ADDR(x) (ALIGN_UP((x), image_target->voidp_sizeof))
 
-#ifdef HAVE_LIBLZMA
+#ifdef USE_LIBLZMA
 #include <lzma.h>
 #endif
 
@@ -709,7 +709,7 @@ compress_kernel_lzma (char *kernel_img, size_t kernel_size,
     grub_util_error ("%s", _("cannot compress the kernel image"));
 }
 
-#ifdef HAVE_LIBLZMA
+#ifdef USE_LIBLZMA
 static void
 compress_kernel_xz (char *kernel_img, size_t kernel_size,
                    char **core_img, size_t *core_size)
@@ -772,7 +772,7 @@ compress_kernel (const struct grub_install_image_target_desc *image_target, char
       return;
     }
 
-#ifdef HAVE_LIBLZMA
+#ifdef USE_LIBLZMA
  if (image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS
      && (comp == GRUB_COMPRESSION_XZ))
    {