--- configure.ac.orig 2009-05-16 17:20:59.149724828 +0800 +++ configure.ac 2009-05-16 17:21:31.507291606 +0800 @@ -26,6 +26,7 @@ dnl ##### Check for pkgconfig PKG_PROG_PKG_CONFIG +POPPLER_PACKAGES= dnl Enable these unconditionally. AC_DEFINE([OPI_SUPPORT], [1], [Generate OPI comments in PS output.]) @@ -210,6 +211,7 @@ if test "x$freetype_pkgconfig" = "xyes"; then AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files]) + POPPLER_PACKAGES="$POPPLER_PACKAGES freetype2" else @@ -454,17 +456,24 @@ dnl Color Management dnl +LCMS_LIBS= +LCMS_CFLAGS= + AC_ARG_ENABLE(cms, AC_HELP_STRING([--disable-cms], [Don't use color management system.]), enable_cms=$enableval, enable_cms="yes") if test x$enable_cms = xyes; then - AC_CHECK_LIB([lcms],cmsOpenProfileFromFile,, - AC_MSG_ERROR("*** lcms library not found ***")) - AC_CHECK_HEADERS([lcms.h],, - AC_MSG_ERROR("*** lcms headers not found ***")) + PKG_CHECK_MODULES(LCMS, lcms, [lcms_pkgconfig=yes], [lcms_pkgconfig=no]) + if test "x$lcms_pkgconfig" != "xyes"; then + AC_MSG_ERROR("*** lcms library not found ***") + fi AC_DEFINE(USE_CMS, 1, [Defines if use cms]) + POPPLER_PACKAGES="$POPPLER_PACKAGES lcms" + CFLAGS="$CFLAGS $LCMS_CFLAGS" + CXXFLAGS="$CXXFLAGS $LCMS_CFLAGS" + LIBS="$LIBS $LCMS_LIBS" fi AM_CONDITIONAL(USE_CMS, test x$enable_cms = xyes) @@ -493,6 +502,7 @@ AC_SUBST(PC_REQUIRES) AC_SUBST(PC_REQUIRES_PRIVATE) +AC_SUBST(POPPLER_PACKAGES) AC_OUTPUT([ Makefile --- poppler.pc.in.orig 2009-05-16 16:58:30.578953273 +0800 +++ poppler.pc.in 2009-05-16 13:50:50.939929863 +0800 @@ -6,6 +6,7 @@ Name: poppler Description: PDF rendering library Version: @VERSION@ +Requires: @POPPLER_PACKAGES@ Libs: -L${libdir} -lpoppler Cflags: -I${includedir}/poppler --- poppler/Makefile.am.orig 2009-05-16 11:44:39.497824869 +0800 +++ poppler/Makefile.am 2009-05-16 17:01:57.264261488 +0800 @@ -105,10 +105,6 @@ endif -if USE_CMS -cms_libs = -llcms -endif - INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/goo \