summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-20 09:51:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-21 17:25:46 +0200
commit685eff8c9e6e6097b6f9e365fd6554e10adef063 (patch)
tree27d3df61574b56eae92178df22f057d81c930c2b
parentf948108d85a3e7a965e61e22999d29d321acba94 (diff)
libtiff: enable jpeg and zlib
Change-Id: Ied6ab75342f5cdaadefbff7f75fbe63e9d67e992 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134667 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--external/libtiff/ExternalProject_libtiff.mk26
-rw-r--r--external/libtiff/UnpackedTarball_libtiff.mk4
-rw-r--r--external/libtiff/libtiff.linknolibs.patch11
3 files changed, 38 insertions, 3 deletions
diff --git a/external/libtiff/ExternalProject_libtiff.mk b/external/libtiff/ExternalProject_libtiff.mk
index c973ca025dd9..e9ecbdf86765 100644
--- a/external/libtiff/ExternalProject_libtiff.mk
+++ b/external/libtiff/ExternalProject_libtiff.mk
@@ -13,33 +13,53 @@ $(eval $(call gb_ExternalProject_register_targets,libtiff,\
build \
))
+$(eval $(call gb_ExternalProject_use_externals,libtiff,\
+ libjpeg \
+ zlib \
+))
+
$(eval $(call gb_ExternalProject_use_autoconf,libtiff,build))
+# using ac_cv_lib_z_inflateEnd=yes to skip test for our
+# static windows lib where the name is zlib not z
+# using ac_cv_lib_jpeg_jpeg_read_scanlines to skip test
+# for our static windows lib where the name is libjpeg-turbo.lib
+# not libjpeg.lib
+# we're building this statically anyway so the lib isn't
+# used during the link done here
+
$(call gb_ExternalProject_get_state_target,libtiff,build) :
$(call gb_Trace_StartRange,libtiff,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
&& MAKE=$(MAKE) $(gb_RUN_CONFIGURE) ./configure \
--enable-static \
- --with-pic \
+ --enable-jpeg \
+ --enable-zlib \
--disable-shared \
--disable-cxx \
--disable-libdeflate \
--disable-jbig \
- --disable-jpeg \
--disable-lerc \
--disable-lzma \
--disable-mdi \
--disable-webp \
--disable-win32-io \
--disable-zstd \
+ --with-pic \
--without-x \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,libtiff)" \
+ $(if $(SYSTEM_ZLIB),,--with-zlib-include-dir="$(call gb_UnpackedTarball_get_dir,zlib)") \
+ $(if $(SYSTEM_ZLIB),,--with-zlib-lib-dir="$(gb_StaticLibrary_WORKDIR)") \
+ $(if $(SYSTEM_LIBJPEG),,--with-jpeg-include-dir="$(call gb_UnpackedTarball_get_dir,libjpeg-turbo)") \
+ $(if $(SYSTEM_LIBJPEG),,--with-jpeg-lib-dir="$(gb_StaticLibrary_WORKDIR)") \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
LDFLAGS="$(call gb_ExternalProject_get_link_flags,libtiff)" \
+ ac_cv_lib_z_inflateEnd=yes \
+ ac_cv_lib_jpeg_jpeg_read_scanlines=yes \
$(gb_CONFIGURE_PLATFORMS) \
- && $(MAKE) \
+ && cd libtiff && $(MAKE) libtiff.la \
)
$(call gb_Trace_EndRange,libtiff,EXTERNAL)
diff --git a/external/libtiff/UnpackedTarball_libtiff.mk b/external/libtiff/UnpackedTarball_libtiff.mk
index 30701edc56cf..ce5a3a53d36a 100644
--- a/external/libtiff/UnpackedTarball_libtiff.mk
+++ b/external/libtiff/UnpackedTarball_libtiff.mk
@@ -13,4 +13,8 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libtiff,$(LIBTIFF_TARBALL)))
$(eval $(call gb_UnpackedTarball_set_patchlevel,libtiff,0))
+$(eval $(call gb_UnpackedTarball_add_patches,libtiff,\
+ external/libtiff/libtiff.linknolibs.patch \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/external/libtiff/libtiff.linknolibs.patch b/external/libtiff/libtiff.linknolibs.patch
new file mode 100644
index 000000000000..0017ca9ca345
--- /dev/null
+++ b/external/libtiff/libtiff.linknolibs.patch
@@ -0,0 +1,11 @@
+--- libtiff/Makefile.in 2022-05-21 15:32:48.069999327 +0100
++++ libtiff/Makefile.in 2022-05-21 15:32:59.051499293 +0100
+@@ -372,7 +372,7 @@
+ LDFLAGS = @LDFLAGS@
+ LIBDIR = @LIBDIR@
+ LIBOBJS = @LIBOBJS@
+-LIBS = @LIBS@
++#LIBS = @LIBS@
+ LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@
+ LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@
+ LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@