summaryrefslogtreecommitdiff
path: root/external/lcms2
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2013-10-18 18:59:17 +0200
committerDavid Tardon <dtardon@redhat.com>2013-10-19 07:33:08 +0000
commit63f6d64ca1f6944953c448f8f75acedb5df991c4 (patch)
tree584a8a5d2d57416b9ab663b18ee1994d69e13b17 /external/lcms2
parenta52215833280fd2c76d6df491a199f1ffab3e040 (diff)
fdo#70393: move lcms2 to a subdir of external
Change-Id: I122a8564795f3a422d6bb10a5d6a845b72e77102 Reviewed-on: https://gerrit.libreoffice.org/6327 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'external/lcms2')
-rw-r--r--external/lcms2/ExternalPackage_lcms2.mk32
-rw-r--r--external/lcms2/ExternalProject_lcms2.mk38
-rw-r--r--external/lcms2/Makefile7
-rw-r--r--external/lcms2/Module_lcms2.mk18
-rw-r--r--external/lcms2/README3
-rw-r--r--external/lcms2/UnpackedTarball_lcms2.mk20
-rw-r--r--external/lcms2/lcms2-2.4-windows.patch44
-rw-r--r--external/lcms2/lcms2.patch20
8 files changed, 182 insertions, 0 deletions
diff --git a/external/lcms2/ExternalPackage_lcms2.mk b/external/lcms2/ExternalPackage_lcms2.mk
new file mode 100644
index 000000000000..395be9a1b9f3
--- /dev/null
+++ b/external/lcms2/ExternalPackage_lcms2.mk
@@ -0,0 +1,32 @@
+# -*- 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_ExternalPackage_ExternalPackage,lcms2,lcms2))
+$(eval $(call gb_ExternalPackage_use_external_project,lcms2,lcms2))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,lcms2,lib/liblcms2.dylib,src/.libs/liblcms2.dylib))
+$(eval $(call gb_ExternalPackage_add_library_for_install,lcms2,lib/liblcms2.2.dylib,src/.libs/liblcms2.2.dylib))
+else ifeq ($(filter-out IOS ANDROID,$(OS)),)
+$(eval $(call gb_ExternalPackage_add_file,lcms2,lib/liblcms2.a,src/.libs/liblcms2.a))
+else ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(eval $(call gb_ExternalPackage_add_file,lcms2,lib/liblcms2.dll.a,src/.libs/liblcms2.dll.a))
+$(eval $(call gb_ExternalPackage_add_library_for_install,lcms2,bin/liblcms2-2.dll,src/.libs/liblcms2-2.dll))
+else ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_file,lcms2,lib/lcms2$(if $(MSVC_USE_DEBUG_RUNTIME),d).lib,bin/lcms2.lib))
+# note: the lcms2d.lib references LCMS2.DLL (without D!) but the dll is
+# actually called LCMS2D.DLL then
+$(eval $(call gb_ExternalPackage_add_library_for_install,lcms2,bin/lcms2.dll,bin/lcms2$(if $(MSVC_USE_DEBUG_RUNTIME),d).dll))
+endif
+else
+$(eval $(call gb_ExternalPackage_add_symbolic_link,lcms2,lib/liblcms2.so,liblcms2.so.2))
+$(eval $(call gb_ExternalPackage_add_library_for_install,lcms2,lib/liblcms2.so.2,src/.libs/liblcms2.so.2.0.4))
+endif
+# vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/ExternalProject_lcms2.mk b/external/lcms2/ExternalProject_lcms2.mk
new file mode 100644
index 000000000000..e128b24f5ea4
--- /dev/null
+++ b/external/lcms2/ExternalProject_lcms2.mk
@@ -0,0 +1,38 @@
+# -*- 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,lcms2))
+
+$(eval $(call gb_ExternalProject_register_targets,lcms2,\
+ build \
+))
+
+ifeq ($(COM),MSC)
+
+$(call gb_ExternalProject_get_state_target,lcms2,build):
+ $(call gb_ExternalProject_run,build,\
+ MSBuild.exe lcms2_DLL.vcxproj \
+ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ /p:Platform=Win32 /p:TargetName=lcms2 \
+ $(if $(filter 110,$(VCVER)),/p:PlatformToolset=v110 /p:VisualStudioVersion=11.0) \
+ ,Projects/VC2010/lcms2_DLL)
+else
+$(call gb_ExternalProject_get_state_target,lcms2,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --without-jpeg --without-tiff --with-pic \
+ $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ CPPFLAGS=" $(SOLARINC)" \
+ $(if $(filter-out WNTGCC,$(OS)$(COM)),,CPPFLAGS=" -DCMS_DLL_BUILD") \
+ $(if $(filter IOS ANDROID,$(OS)), --disable-shared --enable-static, --enable-shared --disable-static) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && cd src \
+ && $(MAKE) \
+ )
+endif
+# vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/Makefile b/external/lcms2/Makefile
new file mode 100644
index 000000000000..e4968cf85fb6
--- /dev/null
+++ b/external/lcms2/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/lcms2/Module_lcms2.mk b/external/lcms2/Module_lcms2.mk
new file mode 100644
index 000000000000..807dbae43854
--- /dev/null
+++ b/external/lcms2/Module_lcms2.mk
@@ -0,0 +1,18 @@
+# -*- 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,lcms2))
+
+$(eval $(call gb_Module_add_targets,lcms2,\
+ UnpackedTarball_lcms2 \
+ ExternalPackage_lcms2 \
+ ExternalProject_lcms2 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/README b/external/lcms2/README
new file mode 100644
index 000000000000..10b18a5ad939
--- /dev/null
+++ b/external/lcms2/README
@@ -0,0 +1,3 @@
+lcms2 (little cms engine)
+lcms2: Little cms is a small, speed optimized color management engine.
+with the new libcdr, writerperfect will depend on lcms2 \ No newline at end of file
diff --git a/external/lcms2/UnpackedTarball_lcms2.mk b/external/lcms2/UnpackedTarball_lcms2.mk
new file mode 100644
index 000000000000..b128ba3936de
--- /dev/null
+++ b/external/lcms2/UnpackedTarball_lcms2.mk
@@ -0,0 +1,20 @@
+# -*- 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,lcms2))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,lcms2,$(LCMS2_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,lcms2,3))
+
+$(eval $(call gb_UnpackedTarball_add_patches,lcms2,\
+ external/lcms2/lcms2.patch \
+ external/lcms2/lcms2-2.4-windows.patch \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/lcms2-2.4-windows.patch b/external/lcms2/lcms2-2.4-windows.patch
new file mode 100644
index 000000000000..f1c681aee7f2
--- /dev/null
+++ b/external/lcms2/lcms2-2.4-windows.patch
@@ -0,0 +1,44 @@
+--- misc/lcms2-2.4/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcproj 2012-09-10 18:01:51.000000000 +0200
++++ misc/build/lcms2-2.4/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcproj 2012-10-05 22:35:01.607191700 +0200
+@@ -205,6 +205,10 @@
+ >
+ </File>
+ <File
++ RelativePath="..\..\..\src\cmshalf.c"
++ >
++ </File>
++ <File
+ RelativePath="..\..\..\src\cmsintrp.c"
+ >
+ </File>
+--- misc/lcms2-2.4/Projects/VC2010/lcms2_static/lcms2_static.vcproj 2012-09-10 18:01:51.000000000 +0200
++++ misc/build/lcms2-2.4/Projects/VC2010/lcms2_static/lcms2_static.vcproj 2012-10-05 22:35:28.168963200 +0200
+@@ -175,6 +175,10 @@
+ >
+ </File>
+ <File
++ RelativePath="..\..\..\src\cmshalf.c"
++ >
++ </File>
++ <File
+ RelativePath="..\..\..\src\cmsintrp.c"
+ >
+ </File>
+--- misc/lcms2-2.4/include/lcms2.h 2011-12-15 16:45:47.000000000 +0100
++++ misc/build/lcms2-2.4/include/lcms2.h 2012-03-17 22:53:28.731585981 +0100
+@@ -192,6 +192,15 @@ typedef int cmsBool;
+ # endif
+ #endif
+
++// LibreOffice always builds this as DLL and with the stdcall calling
++// convention, so make this usable from outside without having to
++// specify CMS_DLL manually whenever the library is used.
++#ifndef CMS_DLL_BUILD
++#ifndef CMS_DLL
++#define CMS_DLL
++#endif
++#endif
++
+ // Calling convention -- this is hardly platform and compiler dependent
+ #ifdef CMS_IS_WINDOWS_
+ # if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
diff --git a/external/lcms2/lcms2.patch b/external/lcms2/lcms2.patch
new file mode 100644
index 000000000000..d0eca1fb86b3
--- /dev/null
+++ b/external/lcms2/lcms2.patch
@@ -0,0 +1,20 @@
+--- misc/build/lcms2-2.4/config.sub
++++ misc/build/lcms2-2.4/config.sub
+@@ -123,7 +123,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+@@ -1294,7 +1294,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \