[Libreoffice-commits] core.git: Branch 'feature/perfwork5' - config_host.mk.in configure.ac download.lst external/jpeg RepositoryExternal.mk vcl/source

Matúš Kukan matus.kukan at collabora.com
Fri Nov 14 07:04:31 PST 2014


 RepositoryExternal.mk                        |    6 +-
 config_host.mk.in                            |    1 
 configure.ac                                 |   38 ++++++++++++++
 download.lst                                 |    4 -
 external/jpeg/ExternalProject_jpeg.mk        |   36 +++++++++++++
 external/jpeg/Module_jpeg.mk                 |    4 -
 external/jpeg/StaticLibrary_jpeg.mk          |   70 ---------------------------
 external/jpeg/UnpackedTarball_jpeg.mk        |    4 -
 external/jpeg/configs/jconfig.h              |   66 -------------------------
 external/jpeg/jpeg.build.patch.1             |   58 ++++++++++++++++++++++
 external/jpeg/patches/jpeg-8c-jmorecfg.patch |   18 ------
 vcl/source/filter/jpeg/transupp.c            |    3 -
 12 files changed, 143 insertions(+), 165 deletions(-)

New commits:
commit d2735469ff15bea5595085a5e10192bf33e52e4e
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Nov 13 11:16:50 2014 +0100

    Replace internal jpeg with jpeg-turbo
    
    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.
    
    Change-Id: Id87b7072a8acc2578c3abf7e82cb1499e5094dbf

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 911dab1..6b02fd5 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -451,10 +451,10 @@ $(call gb_LinkTarget_set_include,$(1),\
 	-I$(call gb_UnpackedTarball_get_dir,jpeg) \
 	$$(INCLUDE) \
 )
-
-$(call gb_LinkTarget_use_static_libraries,$(1),\
-	jpeg \
+$(call gb_LinkTarget_add_libs,$(1),\
+	$(call gb_UnpackedTarball_get_dir,jpeg)/.libs/libjpeg$(gb_StaticLibrary_PLAINEXT) \
 )
+$(call gb_LinkTarget_use_external_project,$(1),jpeg)
 
 endef
 
diff --git a/config_host.mk.in b/config_host.mk.in
index 98dad1d..b2b3104e 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -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@
diff --git a/configure.ac b/configure.ac
index 26f7b79..8c4183f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7363,7 +7363,45 @@ else
     AC_MSG_RESULT([internal])
     SYSTEM_JPEG=
     BUILD_TYPE="$BUILD_TYPE JPEG"
+    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
 fi
+AC_SUBST(NASM)
 AC_SUBST(SYSTEM_JPEG)
 
 
diff --git a/download.lst b/download.lst
index 13e26e0..b5f9749 100644
--- a/download.lst
+++ b/download.lst
@@ -77,8 +77,8 @@ export JFREEREPORT_LIBREPOSITORY_TARBALL := 8ce2fcd72becf06c41f7201d15373ed9-lib
 export JFREEREPORT_LIBSERIALIZER_TARBALL := f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip
 export JFREEREPORT_LIBXML_TARBALL := ace6ab49184e329db254e454a010f56d-libxml-1.1.7.zip
 export JFREEREPORT_SAC_TARBALL := 39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
-export JPEG_MD5SUM := 3353992aecaee1805ef4109aadd433e7
-export JPEG_TARBALL := jpegsrc.v9a.tar.gz
+export JPEG_MD5SUM := 2c3a68129dac443a72815ff5bb374b05
+export JPEG_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
diff --git a/external/jpeg/ExternalProject_jpeg.mk b/external/jpeg/ExternalProject_jpeg.mk
new file mode 100644
index 0000000..e47fb14
--- /dev/null
+++ b/external/jpeg/ExternalProject_jpeg.mk
@@ -0,0 +1,36 @@
+# -*- 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))
+
+$(eval $(call gb_ExternalProject_use_autoconf,jpeg,configure))
+$(eval $(call gb_ExternalProject_use_autoconf,jpeg,build))
+
+$(eval $(call gb_ExternalProject_register_targets,jpeg,\
+	configure \
+	build \
+))
+
+$(call gb_ExternalProject_get_state_target,jpeg,build) : $(call gb_ExternalProject_get_state_target,jpeg,configure)
+	+$(call gb_ExternalProject_run,build,\
+		$(MAKE) \
+	)
+
+$(call gb_ExternalProject_get_state_target,jpeg,configure) :
+	$(call gb_ExternalProject_run,configure,\
+		MAKE=$(MAKE) ./configure \
+			--with-pic \
+			--enable-static \
+			--disable-shared \
+			--with-jpeg8 \
+			--without-java \
+			--without-turbojpeg \
+	)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/jpeg/Module_jpeg.mk b/external/jpeg/Module_jpeg.mk
index 0b45932..537223a 100644
--- a/external/jpeg/Module_jpeg.mk
+++ b/external/jpeg/Module_jpeg.mk
@@ -12,8 +12,8 @@ $(eval $(call gb_Module_Module,jpeg))
 ifeq ($(SYSTEM_JPEG),)
 
 $(eval $(call gb_Module_add_targets,jpeg,\
-    UnpackedTarball_jpeg \
-    StaticLibrary_jpeg \
+	ExternalProject_jpeg \
+	UnpackedTarball_jpeg \
 ))
 
 endif
diff --git a/external/jpeg/StaticLibrary_jpeg.mk b/external/jpeg/StaticLibrary_jpeg.mk
deleted file mode 100644
index c70f81c..0000000
--- a/external/jpeg/StaticLibrary_jpeg.mk
+++ /dev/null
@@ -1,70 +0,0 @@
-# -*- 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_StaticLibrary_StaticLibrary,jpeg))
-
-$(eval $(call gb_StaticLibrary_set_warnings_not_errors,jpeg))
-
-$(eval $(call gb_StaticLibrary_use_unpacked,jpeg,jpeg))
-
-$(eval $(call gb_StaticLibrary_set_include,jpeg,\
-	-I$(call gb_UnpackedTarball_get_dir,jpeg) \
-	$$(INCLUDE) \
-))
-
-$(eval $(call gb_StaticLibrary_add_generated_cobjects,jpeg,\
-    UnpackedTarball/jpeg/jaricom \
-    UnpackedTarball/jpeg/jcapimin \
-    UnpackedTarball/jpeg/jcapistd \
-    UnpackedTarball/jpeg/jcarith \
-    UnpackedTarball/jpeg/jccoefct \
-    UnpackedTarball/jpeg/jccolor \
-    UnpackedTarball/jpeg/jcdctmgr \
-    UnpackedTarball/jpeg/jchuff \
-    UnpackedTarball/jpeg/jcinit \
-    UnpackedTarball/jpeg/jcmainct \
-    UnpackedTarball/jpeg/jcmarker \
-    UnpackedTarball/jpeg/jcmaster \
-    UnpackedTarball/jpeg/jcomapi \
-    UnpackedTarball/jpeg/jcparam \
-    UnpackedTarball/jpeg/jcprepct \
-    UnpackedTarball/jpeg/jcsample \
-    UnpackedTarball/jpeg/jctrans \
-    UnpackedTarball/jpeg/jdapimin \
-    UnpackedTarball/jpeg/jdapistd \
-    UnpackedTarball/jpeg/jdarith \
-    UnpackedTarball/jpeg/jdatadst \
-    UnpackedTarball/jpeg/jdatasrc \
-    UnpackedTarball/jpeg/jdcoefct \
-    UnpackedTarball/jpeg/jdcolor \
-    UnpackedTarball/jpeg/jddctmgr \
-    UnpackedTarball/jpeg/jdhuff \
-    UnpackedTarball/jpeg/jdinput \
-    UnpackedTarball/jpeg/jdmainct \
-    UnpackedTarball/jpeg/jdmarker \
-    UnpackedTarball/jpeg/jdmaster \
-    UnpackedTarball/jpeg/jdmerge \
-    UnpackedTarball/jpeg/jdpostct \
-    UnpackedTarball/jpeg/jdsample \
-    UnpackedTarball/jpeg/jdtrans \
-    UnpackedTarball/jpeg/jerror \
-    UnpackedTarball/jpeg/jfdctflt \
-    UnpackedTarball/jpeg/jfdctfst \
-    UnpackedTarball/jpeg/jfdctint \
-    UnpackedTarball/jpeg/jidctflt \
-    UnpackedTarball/jpeg/jidctfst \
-    UnpackedTarball/jpeg/jidctint \
-    UnpackedTarball/jpeg/jquant1 \
-    UnpackedTarball/jpeg/jquant2 \
-    UnpackedTarball/jpeg/jmemmgr \
-    UnpackedTarball/jpeg/jmemnobs \
-    UnpackedTarball/jpeg/jutils \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/jpeg/UnpackedTarball_jpeg.mk b/external/jpeg/UnpackedTarball_jpeg.mk
index dae63e2..fa1999c 100644
--- a/external/jpeg/UnpackedTarball_jpeg.mk
+++ b/external/jpeg/UnpackedTarball_jpeg.mk
@@ -11,10 +11,8 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,jpeg))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,jpeg,$(JPEG_TARBALL)))
 
-$(eval $(call gb_UnpackedTarball_add_file,jpeg,jconfig.h,external/jpeg/configs/jconfig.h))
-
 $(eval $(call gb_UnpackedTarball_add_patches,jpeg,\
-    external/jpeg/patches/jpeg-8c-jmorecfg.patch \
+	external/jpeg/jpeg.build.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/jpeg/configs/jconfig.h b/external/jpeg/configs/jconfig.h
deleted file mode 100644
index 0c43051..0000000
--- a/external/jpeg/configs/jconfig.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* jconfig.h.  Generated from jconfig.cfg by configure.  */
-/* jconfig.cfg --- source file edited by configure script */
-/* see jconfig.txt for explanations */
-
-#define HAVE_PROTOTYPES 1
-#define HAVE_UNSIGNED_CHAR 1
-#define HAVE_UNSIGNED_SHORT 1
-/* #undef void */
-/* #undef const */
-/* #undef CHAR_IS_UNSIGNED */
-#define HAVE_STDDEF_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_LOCALE_H 1
-/* #undef NEED_BSD_STRINGS */
-/* #undef NEED_SYS_TYPES_H */
-/* #undef NEED_FAR_POINTERS */
-/* #undef NEED_SHORT_EXTERNAL_NAMES */
-/* Define this if you get warnings about undefined structures. */
-/* #undef INCOMPLETE_TYPES_BROKEN */
-
-/* Define "boolean" as unsigned char, not enum, on Windows systems. */
-#ifdef _WIN32
-#ifndef __RPCNDR_H__		/* don't conflict if rpcndr.h already read */
-typedef unsigned char boolean;
-#endif
-#ifndef FALSE			/* in case these macros already exist */
-#define FALSE	0		/* values of boolean */
-#endif
-#ifndef TRUE
-#define TRUE	1
-#endif
-#define HAVE_BOOLEAN		/* prevent jmorecfg.h from redefining it */
-#endif
-
-#ifdef JPEG_INTERNALS
-
-/* #undef RIGHT_SHIFT_IS_UNSIGNED */
-#ifdef WNT
-#define INLINE __inline
-#elif defined SOLARIS
-#define INLINE
-#else
-#define INLINE inline
-#endif
-/* These are for configuring the JPEG memory manager. */
-/* #undef DEFAULT_MAX_MEM */
-/* #undef NO_MKTEMP */
-
-#endif /* JPEG_INTERNALS */
-
-#ifdef JPEG_CJPEG_DJPEG
-
-#undef BMP_SUPPORTED /* BMP image file format */
-#undef GIF_SUPPORTED /* GIF image file format */
-#undef PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
-/* #undef RLE_SUPPORTED */
-#undef TARGA_SUPPORTED /* Targa image file format */
-
-/* #undef TWO_FILE_COMMANDLINE */
-/* #undef NEED_SIGNAL_CATCHER */
-/* #undef DONT_USE_B_MODE */
-
-/* Define this if you want percent-done progress reports from cjpeg/djpeg. */
-/* #undef PROGRESS_REPORT */
-
-#endif /* JPEG_CJPEG_DJPEG */
diff --git a/external/jpeg/jpeg.build.patch.1 b/external/jpeg/jpeg.build.patch.1
new file mode 100644
index 0000000..cf4cc2a
--- /dev/null
+++ b/external/jpeg/jpeg.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 at 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/patches/jpeg-8c-jmorecfg.patch b/external/jpeg/patches/jpeg-8c-jmorecfg.patch
deleted file mode 100644
index eed791f..0000000
--- a/external/jpeg/patches/jpeg-8c-jmorecfg.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- misc/jpeg-9a/jmorecfg.h	2009-11-20 09:01:24.000000000 +0100
-+++ misc/build/jpeg-9a/jmorecfg.h	2011-03-24 21:29:02.073761750 +0100
-@@ -210,6 +210,7 @@
- /* INT32 must hold at least signed 32-bit values. */
- 
- #ifndef XMD_H			/* X11/xmd.h correctly defines INT32 */
-+#ifndef _SOLAR_H
- #ifndef _BASETSD_H_		/* Microsoft defines it in basetsd.h */
- #ifndef _BASETSD_H		/* MinGW is slightly different */
- #ifndef QGLOBAL_H		/* Qt defines it in qglobal.h */
-@@ -217,6 +218,7 @@
- #endif
- #endif
- #endif
-+#endif
- #endif
- 
- /* Datatype used for image dimensions.  The JPEG standard only supports
diff --git a/vcl/source/filter/jpeg/transupp.c b/vcl/source/filter/jpeg/transupp.c
index 9d4b7b8..b31e416 100644
--- a/vcl/source/filter/jpeg/transupp.c
+++ b/vcl/source/filter/jpeg/transupp.c
@@ -14,8 +14,9 @@
  * 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"


More information about the Libreoffice-commits mailing list