diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-11-17 09:16:34 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-11-17 14:47:57 +0100 |
commit | 71fae5db27255fb51a25a307205a8fe76cc56b6a (patch) | |
tree | cec2164a8b885870975e75d367447dba56f5cdd4 /external | |
parent | 65f41639e219470c80f896129731f9ed6f072b6b (diff) |
Add internal libjpeg-turbo library to be used instead of libjpeg
Unfortunately requires nasm - the netwide assembler -
http://www.nasm.us/
Upstream libjpeg-turbo is meant to be built with CMake on Windows but
thanks to our gcc-wrappers we are able to avoid that.
jpeg is kept mostly for platforms we are cross-compiling to. For now,
it's used also for Mac OS X because jpeg-turbo does not build there,
which should be fixed later.
Change-Id: Id87b7072a8acc2578c3abf7e82cb1499e5094dbf
Diffstat (limited to 'external')
-rw-r--r-- | external/Module_external.mk | 1 | ||||
-rw-r--r-- | external/jpeg-turbo/ExternalProject_jpeg-turbo.mk | 37 | ||||
-rw-r--r-- | external/jpeg-turbo/Makefile | 7 | ||||
-rw-r--r-- | external/jpeg-turbo/Module_jpeg-turbo.mk | 21 | ||||
-rw-r--r-- | external/jpeg-turbo/README | 6 | ||||
-rw-r--r-- | external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk | 19 | ||||
-rw-r--r-- | external/jpeg-turbo/jpeg-turbo.build.patch.1 | 58 | ||||
-rw-r--r-- | external/jpeg-turbo/jpeg-turbo.win_build.patch.1 | 15 |
8 files changed, 164 insertions, 0 deletions
diff --git a/external/Module_external.mk b/external/Module_external.mk index 688e33503e53..6d38fd583939 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -52,6 +52,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,ICU,icu) \ $(call gb_Helper_optional,JFREEREPORT,jfreereport) \ $(call gb_Helper_optional,JPEG,jpeg) \ + $(call gb_Helper_optional,JPEG_TURBO,jpeg-turbo) \ $(call gb_Helper_optional,LANGUAGETOOL,languagetool) \ $(call gb_Helper_optional,LCMS2,lcms2) \ $(call gb_Helper_optional,LIBATOMIC_OPS,libatomic_ops) \ diff --git a/external/jpeg-turbo/ExternalProject_jpeg-turbo.mk b/external/jpeg-turbo/ExternalProject_jpeg-turbo.mk new file mode 100644 index 000000000000..d9ac7e56d0e4 --- /dev/null +++ b/external/jpeg-turbo/ExternalProject_jpeg-turbo.mk @@ -0,0 +1,37 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalProject_ExternalProject,jpeg-turbo)) + +$(eval $(call gb_ExternalProject_use_autoconf,jpeg-turbo,configure)) +$(eval $(call gb_ExternalProject_use_autoconf,jpeg-turbo,build)) + +$(eval $(call gb_ExternalProject_register_targets,jpeg-turbo,\ + configure \ + build \ +)) + +$(call gb_ExternalProject_get_state_target,jpeg-turbo,build) : $(call gb_ExternalProject_get_state_target,jpeg-turbo,configure) + +$(call gb_ExternalProject_run,build,\ + $(MAKE) \ + ) + +$(call gb_ExternalProject_get_state_target,jpeg-turbo,configure) : + $(call gb_ExternalProject_run,configure,\ + MAKE=$(MAKE) ./configure \ + --build=$(if $(filter WNT,$(OS)),i686-pc-cygwin,$(BUILD_PLATFORM)) \ + --with-pic \ + --enable-static \ + --disable-shared \ + --with-jpeg8 \ + --without-java \ + --without-turbojpeg \ + ) + +# vim: set noet sw=4 ts=4: diff --git a/external/jpeg-turbo/Makefile b/external/jpeg-turbo/Makefile new file mode 100644 index 000000000000..e4968cf85fb6 --- /dev/null +++ b/external/jpeg-turbo/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/jpeg-turbo/Module_jpeg-turbo.mk b/external/jpeg-turbo/Module_jpeg-turbo.mk new file mode 100644 index 000000000000..87cd24770973 --- /dev/null +++ b/external/jpeg-turbo/Module_jpeg-turbo.mk @@ -0,0 +1,21 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,jpeg-turbo)) + +ifeq ($(WITH_JPEG_TURBO),TRUE) + +$(eval $(call gb_Module_add_targets,jpeg-turbo,\ + ExternalProject_jpeg-turbo \ + UnpackedTarball_jpeg-turbo \ +)) + +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/jpeg-turbo/README b/external/jpeg-turbo/README new file mode 100644 index 000000000000..46eff7cb7487 --- /dev/null +++ b/external/jpeg-turbo/README @@ -0,0 +1,6 @@ +External library for reading/writing jpegs + +This is only used by the jpeg import filter that is provided +for use by VCL see [[vcl/source/filter/jpeg]] + +From [http://www.libjpeg-turbo.org/]. diff --git a/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk b/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk new file mode 100644 index 000000000000..2cb2aa44a627 --- /dev/null +++ b/external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk @@ -0,0 +1,19 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,jpeg-turbo)) + +$(eval $(call gb_UnpackedTarball_set_tarball,jpeg-turbo,$(JPEG_TURBO_TARBALL))) + +$(eval $(call gb_UnpackedTarball_add_patches,jpeg-turbo,\ + external/jpeg-turbo/jpeg-turbo.build.patch.1 \ + $(if $(filter WNT,$(OS)),external/jpeg-turbo/jpeg-turbo.win_build.patch.1) \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/jpeg-turbo/jpeg-turbo.build.patch.1 b/external/jpeg-turbo/jpeg-turbo.build.patch.1 new file mode 100644 index 000000000000..cf4cc2ad7ded --- /dev/null +++ b/external/jpeg-turbo/jpeg-turbo.build.patch.1 @@ -0,0 +1,58 @@ +diff -ur jpeg.org/configure jpeg/configure +--- jpeg.org/configure 2014-11-14 12:05:43.345386578 +0100 ++++ jpeg/configure 2014-11-14 12:08:59.077388882 +0100 +@@ -22977,10 +22977,6 @@ + else + rm -rf conftest* + echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +- { { echo "$as_me:$LINENO: error: configuration problem: maybe object file format mismatch." >&5 +-echo "$as_me: error: configuration problem: maybe object file format mismatch." >&2;} +- { (exit 1); exit 1; }; } + fi + + +@@ -23179,10 +23175,6 @@ + else + rm -rf conftest* + echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +- { { echo "$as_me:$LINENO: error: configuration problem: maybe object file format mismatch." >&5 +-echo "$as_me: error: configuration problem: maybe object file format mismatch." >&2;} +- { (exit 1); exit 1; }; } + fi + + +diff -ur jpeg.org/Makefile.am jpeg/Makefile.am +--- jpeg.org/Makefile.am 2014-11-14 12:05:43.349386578 +0100 ++++ jpeg/Makefile.am 2014-11-14 12:06:21.005387021 +0100 +@@ -160,8 +160,6 @@ + rm -rf `find $(distdir) -name .svn` + + +-SUBDIRS += md5 +- + MD5_JPEG_INT = 9a68f56bc76e466aa7e52f415d0f4a5f + MD5_JPEG_FAST = 0e1502e7fa421835e376a314fac2a39f + MD5_JPEG_FAST_100 = 7bf72a8e741d64eecb960c97323af77c +diff -ur jpeg.org/Makefile.in jpeg/Makefile.in +--- jpeg.org/Makefile.in 2014-11-14 12:05:43.333386578 +0100 ++++ jpeg/Makefile.in 2014-11-14 12:20:00.689396668 +0100 +@@ -264,7 +264,7 @@ + HEADERS = $(include_HEADERS) $(nodist_include_HEADERS) + ETAGS = etags + CTAGS = ctags +-DIST_SUBDIRS = java simd md5 ++DIST_SUBDIRS = java simd + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + distdir = $(PACKAGE)-$(VERSION) + top_distdir = $(distdir) +@@ -442,7 +442,7 @@ + jidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c jmemnobs.c $(am__append_3) \ + $(am__append_4) $(am__append_5) $(am__append_10) +-SUBDIRS = java $(am__append_9) md5 ++SUBDIRS = java $(am__append_9) + @WITH_TURBOJPEG_TRUE@libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) \ + @WITH_TURBOJPEG_TRUE@ turbojpeg.c turbojpeg.h transupp.c \ + @WITH_TURBOJPEG_TRUE@ transupp.h jdatadst-tj.c jdatasrc-tj.c \ diff --git a/external/jpeg-turbo/jpeg-turbo.win_build.patch.1 b/external/jpeg-turbo/jpeg-turbo.win_build.patch.1 new file mode 100644 index 000000000000..1dc5b1e48ee8 --- /dev/null +++ b/external/jpeg-turbo/jpeg-turbo.win_build.patch.1 @@ -0,0 +1,15 @@ +diff -ur jpeg.org/simd/Makefile.in jpeg/simd/Makefile.in +--- jpeg.org/simd/Makefile.in 2014-11-14 21:55:21.557802955 +0100 ++++ jpeg/simd/Makefile.in 2014-11-14 21:57:16.845804312 +0100 +@@ -583,8 +583,9 @@ + .asm.lo: + $(LIBTOOL) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@ + +-jsimdcfg.inc: $(srcdir)/jsimdcfg.inc.h ../jpeglib.h ../jconfig.h ../jmorecfg.h +- $(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) "^[\;%]|^\ %" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@ ++jsimdcfg.inc: $(top_srcdir)/win/jsimdcfg.inc ++ cp $< $@ ++ + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: |