From b05a2733918afad8f4d224e0fbbf80dc73475bf4 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Wed, 27 Apr 2016 23:15:08 -0700 Subject: [PATCH] Issue 692: More robust check for lzma_stream_encoder_mt --- configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 851007d7a..ca8bf6b1c 100644 --- a/configure.ac +++ b/configure.ac @@ -366,7 +366,17 @@ AC_ARG_WITH([lzma], if test "x$with_lzma" != "xno"; then AC_CHECK_HEADERS([lzma.h]) AC_CHECK_LIB(lzma,lzma_stream_decoder) - AC_CHECK_FUNCS([lzma_stream_encoder_mt]) + # Some pre-release (but widely distributed) versions of liblzma + # included a disabled version of lzma_stream_encoder_mt that + # fools a naive AC_CHECK_LIB or AC_CHECK_FUNC, so we need + # to do something more complex here: + AC_CACHE_CHECK( + [whether we have multithread support in lzma], + ac_cv_lzma_has_mt, + [AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[#include ]], + [[lzma_stream_encoder_mt(0, 0);]])], + [ac_cv_lzma_has_mt=yes], [ac_cv_lzma_has_mt=no])]) fi AC_ARG_WITH([lzo2], -- 2.47.3