Add support for lcms2

pull/2/head
Slávek Banko 10 years ago
parent d1c3bac8d2
commit 87d533f7af

@ -19,30 +19,31 @@ AM_PROG_CC_C_O
# -----------------------------------------------------------------
have_lcms_header='no'
KDE_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
if test "$have_lcms_header" = 'yes'
then
AC_DEFINE(LCMS_HEADER, <lcms/lcms.h>, [The correct header])
KDE_CHECK_HEADER(lcms2.h,have_lcms2_header='yes',,)
if test "$have_lcms2_header" = 'yes'; then
AC_DEFINE(LCMS_HEADER, <lcms2.h>, [LCMS header])
else
# Alternative! Debian does it this way...
KDE_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
if test "$have_lcms_header" = 'yes'
then
AC_DEFINE(LCMS_HEADER, <lcms.h>, [The correct header])
if test "$have_lcms_header" = 'yes'; then
AC_DEFINE(LCMS_HEADER, <lcms.h>, [LCMS header])
else
KDE_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
if test "$have_lcms_header" = 'yes'; then
AC_DEFINE(LCMS_HEADER, <lcms/lcms.h>, [LCMS header])
fi
fi
fi
LCMS_LIBS=''
have_lcms='no'
if test "$have_lcms_header" = 'yes'
then
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
saved_libs=$LIBS
LIBS="$LIBS -llcms"
CFLAGS="$CFLAGS $all_includes -I/usr/include/tqt"
LDFLAGS="$LDFLAGS $all_libraries"
saved_libs=$LIBS
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
CFLAGS="$CFLAGS $all_includes -I/usr/include/tqt"
LDFLAGS="$LDFLAGS $all_libraries"
if test "$have_lcms2_header" = 'yes'; then
LIBS="$LIBS -llcms2"
AC_TRY_LINK([
#define inline __inline /* gcc is in ansi mode */
#include LCMS_HEADER
@ -51,12 +52,26 @@ choke!
#endif
], [
cmsOpenProfileFromFile("foo", "r");
],
[LCMS_LIBS='-llcms2'; have_lcms='yes'])
else
if test "$have_lcms_header" = 'yes'; then
LIBS="$LIBS -llcms"
AC_TRY_LINK([
#define inline __inline /* gcc is in ansi mode */
#include LCMS_HEADER
#if LCMS_VERSION < 112
choke!
#endif
], [
cmsOpenProfileFromFile("foo", "r");
],
[LCMS_LIBS='-llcms'; have_lcms='yes'])
LIBS=$saved_libs
CFLAGS=$saved_cflags
LDFLAGS=$saved_ldflags
fi
fi
LIBS=$saved_libs
CFLAGS=$saved_cflags
LDFLAGS=$saved_ldflags
if test -z "$LCMS_LIBS"; then
DO_NOT_COMPILE="$DO_NOT_COMPILE libkdcraw"

@ -43,11 +43,12 @@
NO_JPEG disables decoding of compressed Kodak DC120 files.
NO_LCMS disables the "-p" option.
*/
#include "config.h"
#ifndef NO_JPEG
#include <jpeglib.h>
#endif
#ifndef NO_LCMS
#include <lcms.h>
#include LCMS_HEADER
#endif
#ifdef LOCALEDIR
#include <libintl.h>
@ -7671,7 +7672,9 @@ void CLASS apply_profile (char *input, char *output)
FILE *fp;
unsigned size;
#if LCMS_VERSION < 2000
cmsErrorAction (LCMS_ERROR_SHOW);
#endif
if (strcmp (input, "embed"))
hInProfile = cmsOpenProfileFromFile (input, "r");
else if (profile_length) {

@ -133,7 +133,9 @@ void CLASS apply_profile (char *input, char *output)
FILE *fp;
unsigned size;
#if LCMS_VERSION < 2000
cmsErrorAction (LCMS_ERROR_SHOW);
#endif
if (strcmp (input, "embed"))
hInProfile = cmsOpenProfileFromFile (input, "r");
else if (profile_length) {

@ -29,11 +29,12 @@
NO_JPEG disables decoding of compressed Kodak DC120 files.
NO_LCMS disables the "-p" option.
*/
#include "config.h"
#ifndef NO_JPEG
#include <jpeglib.h>
#endif
#ifndef NO_LCMS
#include <lcms.h>
#include LCMS_HEADER
#endif
#ifdef LOCALEDIR
#include <libintl.h>

Loading…
Cancel
Save