From 7dc24965092d7cc310908d6052913050e88ec072 Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Tue, 7 Oct 2014 18:59:00 +0800 Subject: [PATCH] Fix zlib and lzma libraries check via command line For https://bugzilla.gnome.org/show_bug.cgi?id=737532 add save, change and restore LDFLAGS before AC_CHECK_LIB call when functions gzread and lzma_code are searching inside action-if-found of AC_CHECK_HEADERS --- configure.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index f0a62eaab..6bb1a52ec 100644 --- a/configure.in +++ b/configure.in @@ -391,6 +391,8 @@ if test "$with_zlib" = "no"; then echo "Disabling compression support" else AC_CHECK_HEADERS(zlib.h, + [SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="-L${Z_DIR}/lib" AC_CHECK_LIB(z, gzread,[ AC_DEFINE([HAVE_LIBZ], [1], [Have compression library]) WITH_ZLIB=1 @@ -404,7 +406,8 @@ else esac] else Z_LIBS="-lz" - fi])) + fi]) + LDFLAGS="${SAVE_LDFLAGS}"]) fi AC_SUBST(Z_CFLAGS) @@ -430,6 +433,8 @@ else # private dependencies, though, so static linking may fail. if test "x$have_liblzma" = "xno"; then AC_CHECK_HEADERS(lzma.h, + [SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="-L${LZMA_DIR}/lib" AC_CHECK_LIB(lzma, lzma_code,[ have_liblzma=yes if test "x${LZMA_DIR}" != "x"; then @@ -438,7 +443,8 @@ else else LZMA_LIBS="-llzma" fi], - [have_liblzma=no])) + [have_liblzma=no]) + LDFLAGS="${SAVE_LDFLAGS}"]) fi # Found the library via either method?