Blame SOURCES/jdk8042159-allow_using_system_installed_lcms2-root.patch

b44ac0
diff -ruN openjdk/common/autoconf/libraries.m4 openjdk/common/autoconf/libraries.m4
b44ac0
--- openjdk/common/autoconf/libraries.m4	2013-11-14 22:04:38.039440136 -0500
b44ac0
+++ openjdk/common/autoconf/libraries.m4	2013-11-14 22:05:11.474356424 -0500
b44ac0
@@ -676,6 +676,46 @@
b44ac0
 
b44ac0
   ###############################################################################
b44ac0
   #
b44ac0
+  # Check for the lcms2 library
b44ac0
+  #
b44ac0
+
b44ac0
+  AC_ARG_WITH(lcms, [AS_HELP_STRING([--with-lcms],
b44ac0
+  	[use lcms2 from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
b44ac0
+
b44ac0
+  AC_CHECK_LIB(lcms2, cmsOpenProfileFromFile,
b44ac0
+               [ LCMS_FOUND=yes ],
b44ac0
+               [ LCMS_FOUND=no ])
b44ac0
+
b44ac0
+  AC_MSG_CHECKING([for which lcms to use])
b44ac0
+
b44ac0
+  DEFAULT_LCMS=bundled
b44ac0
+
b44ac0
+  #
b44ac0
+  # If user didn't specify, use DEFAULT_LCMS
b44ac0
+  #
b44ac0
+  if test "x${with_lcms}" = "x"; then
b44ac0
+      with_lcms=${DEFAULT_LCMS}
b44ac0
+  fi
b44ac0
+
b44ac0
+  if test "x${with_lcms}" = "xbundled"; then
b44ac0
+      USE_EXTERNAL_LCMS=false
b44ac0
+      AC_MSG_RESULT([bundled])
b44ac0
+  elif test "x${with_lcms}" = "xsystem"; then
b44ac0
+      if test "x${LCMS_FOUND}" = "xyes"; then
b44ac0
+          USE_EXTERNAL_LCMS=true
b44ac0
+          AC_MSG_RESULT([system])
b44ac0
+      else
b44ac0
+          AC_MSG_RESULT([system not found])
b44ac0
+          AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!])
b44ac0
+      fi
b44ac0
+  else
b44ac0
+      AC_MSG_ERROR([Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled'])
b44ac0
+  fi
b44ac0
+
b44ac0
+  AC_SUBST(USE_EXTERNAL_LCMS)
b44ac0
+
b44ac0
+  ###############################################################################
b44ac0
+  #
b44ac0
   # Check for the png library
b44ac0
   #
b44ac0