diff options
-rw-r--r-- | configure.ac | 8 | ||||
-rwxr-xr-x | libtiff/CMakeLists.txt | 3 | ||||
-rw-r--r-- | libtiff/Makefile.am | 8 |
3 files changed, 18 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index bfa395a1..248c14fa 100644 --- a/configure.ac +++ b/configure.ac @@ -649,6 +649,14 @@ dnl Check for liblerc. dnl --------------------------------------------------------------------------- HAVE_LERC=no +STATIC_LERC=no + +if test "$enable_static" = "no"; then + static_lerc=no +else + static_lerc=yes +fi +AM_CONDITIONAL([STATIC_LERC], [ test "$static_lerc" = yes ]) AC_ARG_ENABLE(lerc, AS_HELP_STRING([--disable-lerc], diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt index 905f52ca..cf9d80c3 100755 --- a/libtiff/CMakeLists.txt +++ b/libtiff/CMakeLists.txt @@ -132,6 +132,9 @@ endif() if(LERC_SUPPORT) target_link_libraries(tiff PRIVATE LERC::LERC) list(APPEND tiff_libs_private_list "${LERC_LIBRARY}") + if(NOT BUILD_SHARED_LIBS) + set_target_properties(tiff PROPERTIES COMPILE_DEFINITIONS LERC_STATIC) + endif() endif() if(LZMA_SUPPORT) target_link_libraries(tiff PRIVATE LibLZMA::LibLZMA) diff --git a/libtiff/Makefile.am b/libtiff/Makefile.am index 44522b62..3988da76 100644 --- a/libtiff/Makefile.am +++ b/libtiff/Makefile.am @@ -147,4 +147,10 @@ mkg3states_LDADD = $(LIBPORT) faxtable: mkg3states (rm -f tif_fax3sm.c && ./mkg3states -b -c const tif_fax3sm.c) -AM_CPPFLAGS = -I$(top_srcdir)/libtiff -I$(top_srcdir)/port +if STATIC_LERC +extra_CPPFLAGS = -DLERC_STATIC +else +extra_CPPFLAGS = +endif + +AM_CPPFLAGS = -I$(top_srcdir)/libtiff -I$(top_srcdir)/port $(extra_CPPFLAGS) |