liblzuma used in decoding MiniDebuginfo is not listed in
libunwind.pc.

Changes in version 2 of patch:

* Don't check HAVE_LZMA. It is redundant.
* Make liblzma as private libraries in use.

Both are suggested by Mike Frysinger <vapier@gentoo.org>.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
 configure.ac               | 4 +++-
 src/Makefile.am            | 4 +---
 src/unwind/libunwind.pc.in | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

--- a/configure.ac
+++ b/configure.ac
@@ -246,19 +246,21 @@ if test x$enable_msabi_support = xyes; t
 fi
 AC_MSG_RESULT([$enable_msabi_support])
 
+LIBLZMA=
 AC_MSG_CHECKING([whether to support LZMA-compressed symbol tables])
 AC_ARG_ENABLE(minidebuginfo,
 AS_HELP_STRING([--enable-minidebuginfo], [Enables support for LZMA-compressed symbol tables]),, [enable_minidebuginfo=auto])
 AC_MSG_RESULT([$enable_minidebuginfo])
 if test x$enable_minidebuginfo != xno; then
    AC_CHECK_LIB([lzma], [lzma_mf_is_supported],
-   [AC_SUBST([LIBLZMA], [-lzma])
+   [LIBLZMA=-llzma
     AC_DEFINE([HAVE_LZMA], [1], [Define if you have liblzma])
     enable_minidebuginfo=yes],
    [if test x$enable_minidebuginfo = xyes; then
       AC_MSG_FAILURE([liblzma not found])
     fi])
 fi
+AC_SUBST([LIBLZMA])
 AM_CONDITIONAL(HAVE_LZMA, test x$enable_minidebuginfo = xyes)
 
 LIBUNWIND___THREAD
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -58,6 +58,7 @@ libunwind_coredump_la_SOURCES = \
 	coredump/_UPT_resume.c
 libunwind_coredump_la_LDFLAGS = $(COMMON_SO_LDFLAGS) \
 				-version-info $(COREDUMP_SO_VERSION)
+libunwind_coredump_la_LIBADD = $(LIBLZMA)
 noinst_HEADERS += coredump/_UCD_internal.h
 
 ### libunwind-setjmp:
@@ -447,6 +448,7 @@ if ARCH_AARCH64
  libunwind_aarch64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_aarch64_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_aarch64_la_LIBADD += libunwind-elf64.la
+ libunwind_aarch64_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_aarch64_la_LIBADD += libunwind.la -lc
 endif
@@ -459,6 +461,7 @@ if ARCH_ARM
  libunwind_arm_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_arm_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_arm_la_LIBADD += libunwind-elf32.la
+ libunwind_arm_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_arm_la_LIBADD += libunwind.la -lc
 endif
@@ -541,6 +544,7 @@ if ARCH_PPC32
  libunwind_ppc32_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
  libunwind_ppc32_la_LIBADD = libunwind-dwarf-generic.la
  libunwind_ppc32_la_LIBADD += libunwind-elf32.la
+ libunwind_ppc32_la_LIBADD += $(LIBLZMA)
 if !REMOTE_ONLY
  libunwind_ppc32_la_LIBADD += libunwind.la -lc
 endif
@@ -594,9 +598,7 @@ endif
 libunwind_la_LDFLAGS =	$(COMMON_SO_LDFLAGS) -XCClinker -nostdlib \
 			$(LDFLAGS_STATIC_LIBCXA) -version-info $(SOVERSION)
 libunwind_la_LIBADD  += -lc $(LIBCRTS)
-if HAVE_LZMA
- libunwind_la_LIBADD += -llzma
-endif
+libunwind_la_LIBADD += $(LIBLZMA)
 
 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I.
 AM_CCASFLAGS = $(AM_CPPFLAGS)
--- a/src/unwind/libunwind.pc.in
+++ b/src/unwind/libunwind.pc.in
@@ -7,3 +7,4 @@ Name: libunwind
 Description: libunwind base library
 Version: @VERSION@
 Libs: -L${libdir} -lunwind
+Libs.private: @LIBLZMA@
