From 54582f9ac65be400bf998d26197eba4f7650a574 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 May 2013 17:26:53 +0000 Subject: [PATCH] Link with liblzma when using built-in libtiff if it's available. New version of libtiff includes code using liblzma if it's available, so we need to link with it in this case. Closes #14963. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 42 ++++++++++++++++++++++++++++++++++++++++++ configure.in | 5 +++++ 2 files changed, 47 insertions(+) diff --git a/configure b/configure index ed244820a4..48cf932fd3 100755 --- a/configure +++ b/configure @@ -22875,6 +22875,48 @@ $as_echo "$as_me: WARNING: system tiff library not found, will use built-in inst ac_configure_args="$ac_configure_args --disable-jpeg" fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_code in -llzma" >&5 +$as_echo_n "checking for lzma_code in -llzma... " >&6; } +if ${ac_cv_lib_lzma_lzma_code+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llzma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lzma_code (); +int +main () +{ +return lzma_code (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lzma_lzma_code=yes +else + ac_cv_lib_lzma_lzma_code=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_code" >&5 +$as_echo "$ac_cv_lib_lzma_lzma_code" >&6; } +if test "x$ac_cv_lib_lzma_lzma_code" = xyes; then : + LIBS="$LIBS -llzma" +fi + + + subdirs="$subdirs src/tiff" diff --git a/configure.in b/configure.in index e00e614b72..e59926b81b 100644 --- a/configure.in +++ b/configure.in @@ -2700,6 +2700,11 @@ if test "$wxUSE_LIBTIFF" != "no" ; then dnl we need to hack around this ac_configure_args="$ac_configure_args --disable-jpeg" fi + + dnl If libtiff configure detects lzma library, it enables support for + dnl LZMA compression and using it requires linking with liblzma. + AC_CHECK_LIB(lzma, lzma_code, [LIBS="$LIBS -llzma"]) + AC_CONFIG_SUBDIRS([src/tiff]) fi fi -- 2.45.2