configure.ac, app: require liblcms2 >= 2.7

and add an lcms2 runtime version check to app/sanity.c

Fixes:
Bug 736701 - LCMS2 rounding errors cause problems with certain GIMP blend modes
This commit is contained in:
Michael Natterer 2016-09-15 12:52:20 +02:00
parent 572d556643
commit 0ce364ee4d
3 changed files with 56 additions and 1 deletions

View File

@ -118,6 +118,7 @@ AM_CPPFLAGS = \
$(GTK_CFLAGS) \
$(PANGOCAIRO_CFLAGS) \
$(GEGL_CFLAGS) \
$(LCMS_CFLAGS) \
$(GEXIV2_CFLAGS) \
-I$(includedir) \
-I$(builddir)/gui
@ -163,6 +164,7 @@ gimpconsoleldadd = \
$(GIO_WINDOWS_LIBS) \
$(GEGL_LIBS) \
$(GLIB_LIBS) \
$(LCMS_LIBS) \
$(GEXIV2_LIBS) \
$(Z_LIBS) \
$(JSON_C_LIBS) \

View File

@ -22,6 +22,7 @@
#include <pango/pango.h>
#include <pango/pangoft2.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <lcms2.h>
#include <gexiv2/gexiv2.h>
#include <gegl.h>
@ -39,6 +40,7 @@ static gchar * sanity_check_pango (void);
static gchar * sanity_check_fontconfig (void);
static gchar * sanity_check_freetype (void);
static gchar * sanity_check_gdk_pixbuf (void);
static gchar * sanity_check_lcms (void);
static gchar * sanity_check_gexiv2 (void);
static gchar * sanity_check_babl (void);
static gchar * sanity_check_gegl (void);
@ -71,6 +73,9 @@ sanity_check (void)
if (! abort_message)
abort_message = sanity_check_gdk_pixbuf ();
if (! abort_message)
abort_message = sanity_check_lcms ();
if (! abort_message)
abort_message = sanity_check_gexiv2 ();
@ -351,6 +356,54 @@ sanity_check_gdk_pixbuf (void)
return NULL;
}
static gchar *
sanity_check_lcms (void)
{
#define LCMS_REQUIRED_MAJOR 2
#define LCMS_REQUIRED_MINOR 7
gint lcms_version = cmsGetEncodedCMMversion ();
if (LCMS_VERSION > lcms_version)
{
return g_strdup_printf
("Liblcms2 version mismatch!\n\n"
"GIMP was compiled against LittleCMS version %d.%d, but the\n"
"LittleCMS version found at runtime is only %d.%d.\n\n"
"Somehow you or your software packager managed\n"
"to install a LittleCMS that is older than what GIMP was\n"
"built against.\n\n"
"Please make sure that the installed LittleCMS version\n"
"is at least %d.%d and that headers and library match.",
LCMS_VERSION / 1000, LCMS_VERSION % 100 / 10,
lcms_version / 1000, lcms_version % 100 / 10,
LCMS_VERSION / 1000, LCMS_VERSION % 100 / 10);
}
if (lcms_version < (LCMS_REQUIRED_MAJOR * 1000 +
LCMS_REQUIRED_MINOR * 10))
{
const gint lcms_major_version = lcms_version / 1000;
const gint lcms_minor_version = lcms_version % 100 / 10;
return g_strdup_printf
("Liblcms2 version too old!\n\n"
"GIMP requires LittleCMS version %d.%d or later.\n"
"Installed LittleCMS version is %d.%d.\n\n"
"Somehow you or your software packager managed\n"
"to install GIMP with an older LittleCMS version.\n\n"
"Please upgrade to LittleCMS version %d.%d or later.",
LCMS_REQUIRED_MAJOR, LCMS_REQUIRED_MINOR,
lcms_major_version, lcms_minor_version,
LCMS_REQUIRED_MAJOR, LCMS_REQUIRED_MINOR);
}
#undef LCMS_REQUIRED_MAJOR
#undef LCMS_REQUIRED_MINOR
return NULL;
}
static gchar *
sanity_check_gexiv2 (void)
{

View File

@ -68,7 +68,7 @@ m4_define([poppler_data_required_version], [0.4.7])
m4_define([libgudev_required_version], [167])
m4_define([gexiv2_required_version], [0.6.1])
m4_define([libmypaint_required_version], [1.3.0])
m4_define([lcms_required_version], [2.6])
m4_define([lcms_required_version], [2.7])
m4_define([libpng_required_version], [1.2.37])
m4_define([liblzma_required_version], [5.0.0])
m4_define([openexr_required_version], [1.6.1])