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(lcms/lcms.h,have_lcms_header='yes',,) if test "$have_lcms_header" = 'yes' then AC_DEFINE(LCMS_HEADER, , [The correct 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, , [The correct header]) 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" LDFLAGS="$LDFLAGS $all_libraries" 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 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 kdelibs 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 #include 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)