Blame SOURCES/jdk8042159-allow_using_system_installed_lcms2-root.patch

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