Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
[geeqie.git] / configure.in
index eb4ba44..599099b 100644 (file)
@@ -25,6 +25,33 @@ AC_DEFINE_UNQUOTED(GQVIEW_HTMLDIR, "$prefix/share/doc/gqview-$VERSION/html", [Lo
 dnl checks for functions
 AC_CHECK_FUNCS(strverscmp)
 
+dnl check for little cms (lcms, this test pulled from gimp)
+AC_ARG_WITH(lcms, [  --without-lcms          build without lcms support])
+
+have_lcms=no
+if test "x$with_lcms" != "xno"; then
+  AC_CHECK_LIB(lcms, cmsCreate_sRGBProfile, [
+    AC_CHECK_HEADER(lcms.h,
+      have_lcms=yes, [
+      AC_CHECK_HEADER(lcms/lcms.h,
+        have_lcms=yes
+        AC_DEFINE(HAVE_LCMS_LCMS_H, 1,
+          [Define to 1 if the lcms header must be included as lcms/lcms.h]))
+      ])
+  ])
+  if test "$have_lcms" = "yes"; then
+    LCMS_LIBS="-llcms"
+    AC_DEFINE(HAVE_LCMS, 1, [define to enable use of color profiles with lcms])
+  else
+    have_lcms="no (lcms not found or unusable)"
+  fi
+else
+  have_lcms="no (lcms support disabled)"
+fi
+
+AC_SUBST(LCMS_LIBS)
+AM_CONDITIONAL(HAVE_LCMS, test "$have_lcms" = "yes")
+
 ALL_LINGUAS="ar be bg ca cs da de eo es et eu fi fr hu id it ja ko nl no pl pt_BR ro ru sk sl sv th tr uk vi zh_CN.GB2312 zh_TW"
 GETTEXT_PACKAGE=$PACKAGE
 AC_SUBST(GETTEXT_PACKAGE)