+# Disable LZMA (lzma library)
+AC_ARG_WITH(lzma,
+ [ --without-lzma disable LZMA support],
+ [with_lzma=$withval],
+ [with_lzma='yes'])
+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
+ AC_MSG_RESULT([-------------------------------------------------------------])
+ AC_MSG_CHECKING(for LZMA)
+ AC_MSG_RESULT()
+ 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_RESULT(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_RESULT(yes)
+ have_lzma='yes'
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
+AC_SUBST(LZMA_LIBS)
+
+dnl ===========================================================================
+