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
This commit is contained in:
parent
65f41639e2
commit
71fae5db27
@ -151,6 +151,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
|
||||
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_LIBXML_TARBALL) \
|
||||
$(call fetch_Optional,JFREEREPORT,JFREEREPORT_SAC_TARBALL) \
|
||||
$(call fetch_Optional,JPEG,JPEG_TARBALL) \
|
||||
$(call fetch_Optional,JPEG_TURBO,JPEG_TURBO_TARBALL) \
|
||||
$(call fetch_Optional,LANGUAGETOOL,LANGUAGETOOL_TARBALL) \
|
||||
$(call fetch_Optional,LCMS2,LCMS2_TARBALL) \
|
||||
$(call fetch_Optional,LIBATOMIC_OPS,LIBATOMIC_OPS_TARBALL) \
|
||||
|
@ -444,6 +444,20 @@ $(call gb_LinkTarget_set_ldflags,$(1),\
|
||||
|
||||
endef
|
||||
|
||||
else ifeq ($(WITH_JPEG_TURBO),TRUE)
|
||||
|
||||
define gb_LinkTarget__use_jpeg
|
||||
$(call gb_LinkTarget_set_include,$(1),\
|
||||
-I$(call gb_UnpackedTarball_get_dir,jpeg-turbo) \
|
||||
$$(INCLUDE) \
|
||||
)
|
||||
$(call gb_LinkTarget_add_libs,$(1),\
|
||||
$(call gb_UnpackedTarball_get_dir,jpeg-turbo)/.libs/libjpeg$(gb_StaticLibrary_PLAINEXT) \
|
||||
)
|
||||
$(call gb_LinkTarget_use_external_project,$(1),jpeg-turbo)
|
||||
|
||||
endef
|
||||
|
||||
else # !SYSTEM_JPEG
|
||||
|
||||
define gb_LinkTarget__use_jpeg
|
||||
|
@ -411,6 +411,7 @@ export MWAW_CFLAGS=$(gb_SPACE)@MWAW_CFLAGS@
|
||||
export MWAW_LIBS=$(gb_SPACE)@MWAW_LIBS@
|
||||
export MYTHES_CFLAGS=$(gb_SPACE)@MYTHES_CFLAGS@
|
||||
export MYTHES_LIBS=$(gb_SPACE)@MYTHES_LIBS@
|
||||
export NASM=@NASM@
|
||||
export NEON_CFLAGS=$(gb_SPACE)@NEON_CFLAGS@
|
||||
export NEON_LIBS=$(gb_SPACE)@NEON_LIBS@
|
||||
export NEON_VERSION=@NEON_VERSION@
|
||||
@ -619,6 +620,7 @@ export WITH_FONTS=@WITH_FONTS@
|
||||
export WITH_GALLERY_BUILD=@WITH_GALLERY_BUILD@
|
||||
export WITH_GSSAPI=@WITH_GSSAPI@
|
||||
export WITH_HELPPACK_INTEGRATION=@WITH_HELPPACK_INTEGRATION@
|
||||
export WITH_JPEG_TURBO=@WITH_JPEG_TURBO@
|
||||
export WITH_KRB5=@WITH_KRB5@
|
||||
export WITH_LANG=@WITH_LANG@
|
||||
export WITH_LANG_LIST=@WITH_LANG_LIST@
|
||||
|
69
configure.ac
69
configure.ac
@ -1890,6 +1890,11 @@ AC_ARG_WITH(system-npapi-headers,
|
||||
[with_system_npapi_headers="$with_system_headers"]
|
||||
)
|
||||
|
||||
AC_ARG_WITH(jpeg-turbo,
|
||||
AS_HELP_STRING([--with-jpeg-turbo],
|
||||
[Use internal libjpeg-turbo library.]),,
|
||||
[with_jpeg_turbo=auto])
|
||||
|
||||
AC_ARG_WITH(webdav,
|
||||
AS_HELP_STRING([--with-webdav],
|
||||
[Specify which library to use for webdav implementation.
|
||||
@ -7342,6 +7347,18 @@ if test "$with_system_jpeg" = "auto"; then
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "$with_jpeg_turbo" = "auto"; then
|
||||
# TODO use jpeg-turbo on Darwin too
|
||||
case "$_os" in
|
||||
WINNT)
|
||||
with_jpeg_turbo=yes
|
||||
;;
|
||||
*)
|
||||
with_jpeg_turbo=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "$with_system_jpeg" = "yes"; then
|
||||
AC_MSG_RESULT([external])
|
||||
SYSTEM_JPEG=TRUE
|
||||
@ -7351,12 +7368,56 @@ if test "$with_system_jpeg" = "yes"; then
|
||||
[AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
|
||||
libo_MINGW_CHECK_DLL([libjpeg])
|
||||
else
|
||||
AC_MSG_RESULT([internal])
|
||||
SYSTEM_JPEG=
|
||||
BUILD_TYPE="$BUILD_TYPE JPEG"
|
||||
fi
|
||||
AC_SUBST(SYSTEM_JPEG)
|
||||
if test "$with_jpeg_turbo" = "yes"; then
|
||||
AC_MSG_RESULT([internal, jpeg-turbo])
|
||||
WITH_JPEG_TURBO=TRUE
|
||||
BUILD_TYPE="$BUILD_TYPE JPEG_TURBO"
|
||||
AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
|
||||
if test -z "$NASM" -a "$build_os" = "cygwin" -a -x "/opt/lo/bin/nasm"; then
|
||||
NASM="/opt/lo/bin/nasm"
|
||||
fi
|
||||
if test -z "$NASM"; then
|
||||
cat << _EOS
|
||||
****************************************************************************
|
||||
You need nasm (Netwide Assembler) to build internal jpeg library.
|
||||
To get one please do:
|
||||
|
||||
_EOS
|
||||
if test "$build_os" = "cygwin"; then
|
||||
cat << _EOS
|
||||
install a pre-compiled binary for Win32
|
||||
|
||||
mkdir -p /opt/lo/bin
|
||||
cd /opt/lo/bin
|
||||
wget http://dev-www.libreoffice.org/bin/cygwin/nasm.exe
|
||||
chmod +x nasm
|
||||
_EOS
|
||||
else
|
||||
cat << _EOS
|
||||
consult http://svn.code.sf.net/p/libjpeg-turbo/code/trunk/BUILDING.txt
|
||||
_EOS
|
||||
fi
|
||||
cat << _EOS
|
||||
|
||||
or get and install one from http://www.nasm.us/
|
||||
|
||||
Then re-run autogen.sh
|
||||
|
||||
Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
|
||||
Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
|
||||
|
||||
_EOS
|
||||
AC_MSG_ERROR([no nasm (Netwide Assembler) found])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([internal, jpeg])
|
||||
BUILD_TYPE="$BUILD_TYPE JPEG"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(NASM)
|
||||
AC_SUBST(SYSTEM_JPEG)
|
||||
AC_SUBST(WITH_JPEG_TURBO)
|
||||
|
||||
dnl ===================================================================
|
||||
dnl Check for system clucene
|
||||
|
@ -79,6 +79,8 @@ export JFREEREPORT_LIBXML_TARBALL := ace6ab49184e329db254e454a010f56d-libxml-1.1
|
||||
export JFREEREPORT_SAC_TARBALL := 39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
|
||||
export JPEG_MD5SUM := 3353992aecaee1805ef4109aadd433e7
|
||||
export JPEG_TARBALL := jpegsrc.v9a.tar.gz
|
||||
export JPEG_TURBO_MD5SUM := 2c3a68129dac443a72815ff5bb374b05
|
||||
export JPEG_TURBO_TARBALL := libjpeg-turbo-1.3.1.tar.gz
|
||||
export LANGTAGREG_MD5SUM := 49c94710f7858b1969d74ff72e6aac84
|
||||
export LANGTAGREG_TARBALL := language-subtag-registry-2014-04-10.tar.bz2
|
||||
export LANGUAGETOOL_TARBALL := b63e6340a02ff1cacfeadb2c42286161-JLanguageTool-1.7.0.tar.bz2
|
||||
|
1
external/Module_external.mk
vendored
1
external/Module_external.mk
vendored
@ -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) \
|
||||
|
37
external/jpeg-turbo/ExternalProject_jpeg-turbo.mk
vendored
Normal file
37
external/jpeg-turbo/ExternalProject_jpeg-turbo.mk
vendored
Normal file
@ -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:
|
7
external/jpeg-turbo/Makefile
vendored
Normal file
7
external/jpeg-turbo/Makefile
vendored
Normal file
@ -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:
|
21
external/jpeg-turbo/Module_jpeg-turbo.mk
vendored
Normal file
21
external/jpeg-turbo/Module_jpeg-turbo.mk
vendored
Normal file
@ -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:
|
6
external/jpeg-turbo/README
vendored
Normal file
6
external/jpeg-turbo/README
vendored
Normal file
@ -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/].
|
19
external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk
vendored
Normal file
19
external/jpeg-turbo/UnpackedTarball_jpeg-turbo.mk
vendored
Normal file
@ -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:
|
58
external/jpeg-turbo/jpeg-turbo.build.patch.1
vendored
Normal file
58
external/jpeg-turbo/jpeg-turbo.build.patch.1
vendored
Normal file
@ -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 \
|
15
external/jpeg-turbo/jpeg-turbo.win_build.patch.1
vendored
Normal file
15
external/jpeg-turbo/jpeg-turbo.win_build.patch.1
vendored
Normal file
@ -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:
|
@ -14,8 +14,10 @@
|
||||
* interfaces.
|
||||
*/
|
||||
|
||||
#include "jerror.h"
|
||||
#include <sal/config.h>
|
||||
|
||||
#include "jinclude.h"
|
||||
#include "jerror.h"
|
||||
#include "jpeglib.h"
|
||||
#include "transupp.h" /* My own external interface */
|
||||
#include "jpegcomp.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user