summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-11-17 09:16:34 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-11-17 14:47:57 +0100
commit71fae5db27255fb51a25a307205a8fe76cc56b6a (patch)
treecec2164a8b885870975e75d367447dba56f5cdd4 /configure.ac
parent65f41639e219470c80f896129731f9ed6f072b6b (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 'configure.ac')
-rw-r--r--configure.ac67
1 files changed, 64 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index e4015693ef94..8ee0ab46e80b 100644
--- a/configure.ac
+++ b/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"
+ 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