diff options
author | Slávek Banko <[email protected]> | 2014-10-09 21:08:16 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2014-10-09 21:08:16 +0200 |
commit | b34c4d8c337aba6d7d44dfd58087ebd6e2d143e3 (patch) | |
tree | 1f28011425bdb7a577ad23d91d0007b9f215e17d /ksvg/configure.in.in | |
parent | e76fc32e0582f8bc801fb2c253dc826fb61873ec (diff) | |
download | tdegraphics-b34c4d8c337aba6d7d44dfd58087ebd6e2d143e3.tar.gz tdegraphics-b34c4d8c337aba6d7d44dfd58087ebd6e2d143e3.zip |
Add support for lcms2
Diffstat (limited to 'ksvg/configure.in.in')
-rw-r--r-- | ksvg/configure.in.in | 92 |
1 files changed, 48 insertions, 44 deletions
diff --git a/ksvg/configure.in.in b/ksvg/configure.in.in index 5643818e..7a19195b 100644 --- a/ksvg/configure.in.in +++ b/ksvg/configure.in.in @@ -113,52 +113,56 @@ fi # Check for lcms have_lcms_header='no' -KDE_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,) -if test "$have_lcms_header" = 'yes' -then - LCMS_LIBS='-llcms' - 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 - LCMS_LIBS='-llcms' - AC_DEFINE(LCMS_HEADER, <lcms.h>, [The correct header]) - - # Try to find the full path of lcms.h - for a in $includedir $prefix/include /usr/include /usr/local/include $kde_extra_includes; do - for b in lcms.h lcms/lcms.h ; do - if test -d "$a" && test -f "$a/$b" ; then - LCMSHDR="$a/$b" - fi - done - done - # Check if lcms.h was found. If not then it means that we didn't search - # the right dirs since the kde check already found a usable lcms.h - if test -n "$LCMSHDR" ; then - # Get lcms version - lcms_ver_line=`cat $LCMSHDR | grep '^// Version' ` - if test -z "$lcms_ver_line" ; then - # Some versions of lcms have the version in /* */ - lcms_ver_line=`cat $LCMSHDR | grep '^/\* Version' ` - fi - lcms_ver=`echo "$lcms_ver_line" | head -n 1 | cut -d ' ' -f 3 ` - - # Get major and minor version numbers - lcms_var_maj=`echo $lcms_ver | cut -d . -f 1` - - # Some versions have a character attached to the end of minor version - lcms_var_min=`echo $lcms_ver | cut -d . -f 2 | sed 's,[^0-9],,g'` - - if test "$lcms_var_maj" -gt 1 || test "$lcms_var_min" -lt 9 ; then - LCMS_LIBS='' - fi - fi - else - LCMS_LIBS='' - fi + KDE_CHECK_HEADER(lcms.h,have_lcms_header='yes',,) + 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' +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 +#if LCMS_VERSION < 112 +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']) + fi fi +LIBS=$saved_libs +CFLAGS=$saved_cflags +LDFLAGS=$saved_ldflags if test -z "$LCMS_LIBS"; then DO_NOT_COMPILE="$DO_NOT_COMPILE ksvg" |