You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
3.7 KiB
135 lines
3.7 KiB
AC_ARG_VAR(PKGCONFIGFOUND, [Path to pkg-config])
|
|
AC_CHECK_PROG(PKGCONFIGFOUND, pkg-config,[yes])
|
|
|
|
#-----------------------------------------------------------------
|
|
# Library API version
|
|
# -----------------------------------------------------------------
|
|
|
|
ABI_MAJOR=4
|
|
VERSION_INFO="4:3:0"
|
|
|
|
AC_SUBST(ABI_MAJOR)
|
|
AC_SUBST(VERSION_INFO)
|
|
|
|
# AM_PROG_CC_C_O to avoid that automake complains for it
|
|
AM_PROG_CC_C_O
|
|
|
|
# -----------------------------------------------------------------
|
|
# lcms check
|
|
# -----------------------------------------------------------------
|
|
|
|
have_lcms_header='no'
|
|
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>, [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 libkdcraw"
|
|
fi
|
|
|
|
AC_SUBST(LCMS_LIBS)
|
|
|
|
#AM_CONDITIONAL(compile_LIBKDCRAW, [test x$have_lcms != xyes])
|
|
|
|
AC_OUTPUT([ libkdcraw/libkdcraw.pc ])
|
|
|
|
# -----------------------------------------------------------------
|
|
# enable hidden visibility only if kde >= 3.3.2 and tdelibs has
|
|
# been compiled with visibility enabled
|
|
# -----------------------------------------------------------------
|
|
|
|
AC_LANG_PUSH(C++)
|
|
libkdcraw_kdemacros_cppflags=$CPPFLAGS
|
|
CPPFLAGS="$CPPFLAGS $all_includes"
|
|
AC_MSG_CHECKING([if kdemacros.h is usable])
|
|
AC_COMPILE_IFELSE(
|
|
[
|
|
#include <kdemacros.h>
|
|
#include <string>
|
|
int other_func( void ) KDE_EXPORT;
|
|
int other_func( void )
|
|
{
|
|
std::string s("KDE_EXPORT");
|
|
return 0;
|
|
}
|
|
],
|
|
[ AC_MSG_RESULT([yes])
|
|
AC_DEFINE(KDEMACROS_USABLE, 1, [kdemacros.h usable]) ],
|
|
[ AC_MSG_RESULT([no]) ]
|
|
)
|
|
CPPFLAGS=$libkdcraw_kdemacros_cppflags
|
|
AC_LANG_POP(C++)
|
|
|
|
# -----------------------------------------------------------------
|
|
# enable OpenMP support to use parallelized code from LibRaw
|
|
# (default: disabled). this mode speed-up demosaicing operations.
|
|
# -----------------------------------------------------------------
|
|
|
|
AC_MSG_CHECKING(whether to enable parallel demosaicing operation from LibRaw using openmp...)
|
|
AC_ARG_ENABLE([openmp], [AC_HELP_STRING([--enable-openmp],
|
|
[enable openmp [default=disabled] ])],
|
|
if test $enableval = yes; then
|
|
[AC_MSG_RESULT(yes)]
|
|
[AC_DEFINE([USING_OPENMP], 1, [using openmp])]
|
|
USING_OPENMP=yes
|
|
[CXXFLAGS="$CXXFLAGS -fopenmp"]
|
|
[OPENMP_LDFLAGS=" -lgomp "]
|
|
fi
|
|
,
|
|
[AC_MSG_RESULT(no)]
|
|
[AC_DEFINE([USING_OPENMP], 0, [using openmp])]
|
|
USING_OPENMP=no
|
|
[OPENMP_LDFLAGS=""]
|
|
)
|
|
AC_SUBST(OPENMP_LDFLAGS)
|