]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 14 Nov 2011 13:18:39 +0000 (13:18 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 14 Nov 2011 13:18:39 +0000 (13:18 +0000)
configure.ac

index a7658ca7651dd4e1a652593d4508b5cacaee5bd3..0326464cfd65655643f6f61ae87c7d284b049d39 100755 (executable)
@@ -2361,36 +2361,22 @@ if test "$with_lzma" != 'yes' ; then
     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
 fi
 
-#
-# Check for LZMA
-#
-have_lzma='no'
-LZMA_LIBS=''
-if test "$with_lzma" != 'no' || test "$with_tiff" != 'no'; then
+LZMA_PKG=""
+if test "x$with_lzma" = "xyes"; then
     AC_MSG_NOTICE([-------------------------------------------------------------])
-  AC_MSG_CHECKING(for LZMA)
-  AC_MSG_NOTICE()
-  failed=0
-  passed=0
-  AC_CHECK_HEADER(lzma.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
-  AC_CHECK_LIB(lzma,lzma_code,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
-  AC_MSG_CHECKING(if LZMA package is complete)
-  if test $passed -gt 0; then
-    if test $failed -gt 0; then
-      AC_MSG_NOTICE(no -- some components failed test)
-      have_lzma='no (failed tests)'
-    else
-      LZMA_LIBS='-llzma'
-      LIBS="$LZMA_LIBS $LIBS"
-      AC_DEFINE(LZMA_DELEGATE,1,Define if you have lzma compression library)
-      AC_MSG_NOTICE(yes)
-      have_lzma='yes'
+    PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
+    AC_MSG_NOTICE([])
+fi
+
+if test "$have_lzma" = 'yes'; then
+    AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
+    if test "$with_modules" = 'no'; then
+        CPPFLAGS="$LZMA_CFLAGS $CPPFLAGS"
     fi
-  else
-    AC_MSG_NOTICE(no)
-  fi
 fi
+
 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
+AC_SUBST(LZMA_CFLAGS)
 AC_SUBST(LZMA_LIBS)
 
 dnl ===========================================================================