Blame SOURCES/jdk8042159-allow_using_system_installed_lcms2-root.patch

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