summaryrefslogtreecommitdiff
path: root/debian/patches/system-lcms.diff
blob: 993bf2317721f97eb8df2bdc28fd944bc546e91d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# DP: taken from http://icedtea.classpath.org/wiki/IcedTea_Patches_for_OpenJDK_8

--- a/common/autoconf/libraries.m4
+++ b/common/autoconf/libraries.m4
@@ -666,6 +666,46 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
 
   ###############################################################################
   #
+  # Check for the lcms2 library
+  #
+
+  AC_ARG_WITH(lcms, [AS_HELP_STRING([--with-lcms],
+  	[use lcms2 from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
+
+  AC_CHECK_LIB(lcms2, cmsOpenProfileFromFile,
+               [ LCMS_FOUND=yes ],
+               [ LCMS_FOUND=no ])
+
+  AC_MSG_CHECKING([for which lcms to use])
+
+  DEFAULT_LCMS=bundled
+
+  #
+  # If user didn't specify, use DEFAULT_LCMS
+  #
+  if test "x${with_lcms}" = "x"; then
+      with_lcms=${DEFAULT_LCMS}
+  fi
+
+  if test "x${with_lcms}" = "xbundled"; then
+      USE_EXTERNAL_LCMS=false
+      AC_MSG_RESULT([bundled])
+  elif test "x${with_lcms}" = "xsystem"; then
+      if test "x${LCMS_FOUND}" = "xyes"; then
+          USE_EXTERNAL_LCMS=true
+          AC_MSG_RESULT([system])
+      else
+          AC_MSG_RESULT([system not found])
+          AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!])
+      fi
+  else
+      AC_MSG_ERROR([Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled'])
+  fi
+
+  AC_SUBST(USE_EXTERNAL_LCMS)
+
+  ###############################################################################
+  #
   # Check for the png library
   #
 
--- a/jdk/make/lib/Awt2dLibraries.gmk
+++ b/jdk/make/lib/Awt2dLibraries.gmk
@@ -667,8 +667,8 @@ endif
 ##########################################################################################
 
 # TODO: Update awt lib path when awt is converted
-$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
-    LIBRARY := lcms, \
+$(eval $(call SetupNativeCompilation,BUILD_LIBJAVALCMS, \
+    LIBRARY := javalcms, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
     LANG := C, \
@@ -687,19 +687,19 @@ $(eval $(call SetupNativeCompilation,BUI
     LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
     LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
     LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
-    LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \
+    LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm -llcms2, \
     LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\
     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
     RC_FLAGS := $(RC_FLAGS) \
-        -D "JDK_FNAME=lcms.dll" \
-        -D "JDK_INTERNAL_NAME=lcms" \
+        -D "JDK_FNAME=javalcms.dll" \
+        -D "JDK_INTERNAL_NAME=javalcms" \
         -D "JDK_FTYPE=0x2L", \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \
+    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavalcms, \
     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
-BUILD_LIBRARIES += $(BUILD_LIBLCMS)
+BUILD_LIBRARIES += $(BUILD_LIBJAVALCMS)
 
-$(BUILD_LIBLCMS): $(BUILD_LIBAWT)
+$(BUILD_LIBJAVALCMS): $(BUILD_LIBAWT)
 
 ##########################################################################################
 
--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java
+++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java
@@ -207,7 +207,7 @@ public class LCMS implements PCMM {
                          * disposer frameworks
                          */
                         System.loadLibrary("awt");
-                        System.loadLibrary("lcms");
+                        System.loadLibrary("javalcms");
                         return null;
                     }
                 });