Blame SOURCES/jdk8042159-allow_using_system_installed_lcms2-root.patch

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