--- old/common/autoconf/libraries.m4 2014-03-19 19:07:46.507829269 -0400 +++ new/common/autoconf/libraries.m4 2014-03-19 19:07:46.443829147 -0400 @@ -654,6 +654,42 @@ ############################################################################### # + # 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_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 + AC_MSG_RESULT([system]) + PKG_CHECK_MODULES([LCMS], [lcms2], [LCMS_FOUND=yes], [LCMS_FOUND=no]) + if test "x${LCMS_FOUND}" = "xyes"; then + USE_EXTERNAL_LCMS=true + else + 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 #