diff options
-rw-r--r-- | libkdcraw/configure.in.in | 53 | ||||
-rw-r--r-- | libkdcraw/dcraw/dcraw.c | 5 | ||||
-rw-r--r-- | libkdcraw/libraw/internal/dcraw_fileio.cpp | 2 | ||||
-rw-r--r-- | libkdcraw/libraw/internal/defines.h | 3 |
4 files changed, 42 insertions, 21 deletions
diff --git a/libkdcraw/configure.in.in b/libkdcraw/configure.in.in index 4fb215f..5d16b42 100644 --- a/libkdcraw/configure.in.in +++ b/libkdcraw/configure.in.in @@ -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 @@ -52,11 +53,25 @@ choke! ], [ 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" diff --git a/libkdcraw/dcraw/dcraw.c b/libkdcraw/dcraw/dcraw.c index fdca9da..2b55333 100644 --- a/libkdcraw/dcraw/dcraw.c +++ b/libkdcraw/dcraw/dcraw.c @@ -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) { diff --git a/libkdcraw/libraw/internal/dcraw_fileio.cpp b/libkdcraw/libraw/internal/dcraw_fileio.cpp index 926009a..3dc44ec 100644 --- a/libkdcraw/libraw/internal/dcraw_fileio.cpp +++ b/libkdcraw/libraw/internal/dcraw_fileio.cpp @@ -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) { diff --git a/libkdcraw/libraw/internal/defines.h b/libkdcraw/libraw/internal/defines.h index ca5038e..462874a 100644 --- a/libkdcraw/libraw/internal/defines.h +++ b/libkdcraw/libraw/internal/defines.h @@ -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> |