KOffice – TDE office suite
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.

configure.in.in 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. #MIN_CONFIG(3.3)
  2. # Remember to synchronize the version number with the file koffice/lib/kofficecore/kofficeversion.h
  3. AM_INIT_AUTOMAKE(koffice, "1.6.3")
  4. CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
  5. AC_CHECK_HEADERS(unistd.h sys/param.h floatingpoint.h paths.h)
  6. AC_C_BIGENDIAN
  7. AC_CHECK_KDEMAXPATHLEN
  8. KDE_INIT_DOXYGEN([The KOffice API Reference], [Version $VERSION])
  9. # Check for GraphicsMagick...
  10. have_graphicsmagick=no
  11. KDE_FIND_PATH(GraphicsMagick-config, GRAPHICS_MAGICK_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
  12. AC_MSG_WARN([Could not find GraphicsMagick anywhere, check http://www.graphicsmagick.org/ for GraphicsMagick >= 1.1.7.])
  13. ])
  14. if test -n "$GRAPHICS_MAGICK_CONFIG"; then
  15. vers=`$GRAPHICS_MAGICK_CONFIG --version 2>/dev/null | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
  16. if test -n "$vers" && test "$vers" -ge 1001007; then
  17. LIBGMAGICK_LIBS="`$GRAPHICS_MAGICK_CONFIG --libs`"
  18. LIBGMAGICK_LDFLAGS="`$GRAPHICS_MAGICK_CONFIG --ldflags`"
  19. LIBGMAGICK_RPATH=
  20. for args in $LIBGMAGICK_LIBS; do
  21. case $args in
  22. -L*)
  23. LIBGMAGICK_RPATH="$LIBMAGICK_RPATH $args"
  24. ;;
  25. esac
  26. done
  27. LIBGMAGICK_RPATH=`echo $LIBGMAGICK_RPATH | $SED -e "s/-L/-R/g"`
  28. LIBGMAGICK_CPPFLAGS="`$GRAPHICS_MAGICK_CONFIG --cppflags`"
  29. AC_DEFINE(HAVE_GMAGICK,1, [GraphicsMagick is available])
  30. have_graphicsmagick=yes
  31. else
  32. AC_MSG_WARN([You need at least GraphicsMagick 1.1.7])
  33. fi
  34. fi
  35. if test ! "$USE_RPATH" = "yes"; then
  36. LIBGMAGICK_RPATH=
  37. fi
  38. AC_SUBST(LIBGMAGICK_LIBS)
  39. AC_SUBST(LIBGMAGICK_LDFLAGS)
  40. AC_SUBST(LIBGMAGICK_CPPFLAGS)
  41. AC_SUBST(LIBGMAGICK_RPATH)
  42. AM_CONDITIONAL(include_graphicsmagick_filter, test "$have_graphicsmagick" = "yes" -a HAVE_GMAGICK)
  43. # End of GraphicsMagick check
  44. # Check for ImageMagick...
  45. have_imagemagick=no
  46. KDE_FIND_PATH(Magick-config, MAGICK_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
  47. AC_MSG_WARN([Could not find ImageMagick anywhere, check http://www.imagemagick.org/ for ImageMagick >= 5.5.2.])
  48. ])
  49. if test -n "$MAGICK_CONFIG"; then
  50. vers=`$MAGICK_CONFIG --version 2>/dev/null | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
  51. if test -n "$vers" && test "$vers" -ge 5005002
  52. then
  53. if test "$vers" -ge 6000003
  54. then
  55. AC_DEFINE(HAVE_MAGICK6, 1, [ImageMagick Version 6])
  56. fi
  57. if test "$vers" -ge 6001000
  58. then
  59. AC_DEFINE(HAVE_MAGICK61, 1, [ImageMagick Version 6.1])
  60. fi
  61. LIBMAGICK_LIBS="`$MAGICK_CONFIG --libs`"
  62. LIBMAGICK_LDFLAGS="`$MAGICK_CONFIG --ldflags`"
  63. LIBMAGICK_RPATH=
  64. for args in $LIBMAGICK_LIBS; do
  65. case $args in
  66. -L*)
  67. LIBMAGICK_RPATH="$LIBMAGICK_RPATH $args"
  68. ;;
  69. esac
  70. done
  71. LIBMAGICK_RPATH=`echo $LIBMAGICK_RPATH | $SED -e "s/-L/-R/g"`
  72. LIBMAGICK_CPPFLAGS="`$MAGICK_CONFIG --cppflags`"
  73. AC_DEFINE(HAVE_MAGICK,1, [ImageMagick is available])
  74. have_imagemagick=yes
  75. else
  76. AC_MSG_WARN([You need at least ImageMagick 5.5.2])
  77. fi
  78. fi
  79. if test ! "$USE_RPATH" = "yes"; then
  80. LIBMAGICK_RPATH=
  81. fi
  82. AC_SUBST(LIBMAGICK_LIBS)
  83. AC_SUBST(LIBMAGICK_LDFLAGS)
  84. AC_SUBST(LIBMAGICK_CPPFLAGS)
  85. AC_SUBST(LIBMAGICK_RPATH)
  86. AM_CONDITIONAL(include_imagemagick_filter, test "$have_imagemagick" = "yes" -a HAVE_MAGICK61 -a ! "$have_graphicsmagick" = "yes" -a ! HAVE_GMAGICK)
  87. # End of ImageMagick check
  88. ##########################################################################
  89. # This last check is copied from kdenonbeta/gsf/configure.in.in
  90. ##########################################################################
  91. # KOFFICE_PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
  92. # defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
  93. # also defines GSTUFF_PKG_ERRORS on error
  94. # Note: This is specially tweaked for karbon's fontconfig check. Please fix
  95. # it before using it for other tests :-)
  96. AC_DEFUN([KOFFICE_PKG_CHECK_MODULES], [
  97. succeeded=no
  98. if test -z "$PKG_CONFIG"; then
  99. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  100. fi
  101. if test "$PKG_CONFIG" = "no" ; then
  102. echo "*** The pkg-config script could not be found. Make sure it is"
  103. echo "*** in your path, or set the PKG_CONFIG environment variable"
  104. echo "*** to the full path to pkg-config."
  105. echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  106. echo "***"
  107. echo "*** Due to that we can't perform the check for fontconfig..." # added for karbon (Werner)
  108. else
  109. PKG_CONFIG_MIN_VERSION=0.9.0
  110. if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
  111. AC_MSG_CHECKING(for $2)
  112. if $PKG_CONFIG --exists "$2" ; then
  113. AC_MSG_RESULT(yes)
  114. succeeded=yes
  115. AC_MSG_CHECKING($1_CFLAGS)
  116. $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
  117. AC_MSG_RESULT($$1_CFLAGS)
  118. AC_MSG_CHECKING($1_LIBS)
  119. $1_LIBS=`$PKG_CONFIG --libs "$2"`
  120. AC_MSG_RESULT($$1_LIBS)
  121. else
  122. $1_CFLAGS=""
  123. $1_LIBS=""
  124. ## If we have a custom action on failure, don't print errors, but
  125. ## do set a variable so people can do so.
  126. $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
  127. ifelse([$4], ,echo $$1_PKG_ERRORS,)
  128. fi
  129. AC_SUBST($1_CFLAGS)
  130. AC_SUBST($1_LIBS)
  131. else
  132. echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
  133. echo "*** See http://www.freedesktop.org/software/pkgconfig"
  134. fi
  135. fi
  136. if test $succeeded = yes; then
  137. ifelse([$3], , :, [$3])
  138. # else # removed for karbon (Werner)
  139. # ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
  140. fi
  141. ])
  142. # --- Check for KDE 3.2 or 3.3 ---
  143. AC_MSG_CHECKING([for KDE version])
  144. AC_LANG_SAVE
  145. AC_LANG_CPLUSPLUS
  146. kdeversion_save_CXXFLAGS="$CXXFLAGS"
  147. kdeversion_safe_LIBS="$LIBS"
  148. LIBS="$LIBS $X_EXTRA_LIBS"
  149. CXXFLAGS="$CXXFLAGS $all_includes"
  150. AC_COMPILE_IFELSE([
  151. #include <kdeversion.h>
  152. #if ! ( KDE_IS_VERSION( 3, 2, 90 ) )
  153. #error KDE 3.2
  154. #endif
  155. ],
  156. need_trinity2_compat="no"
  157. ,
  158. need_trinity2_compat="yes"
  159. )
  160. AC_COMPILE_IFELSE([
  161. #include <kdeversion.h>
  162. #if ! ( KDE_IS_VERSION( 3, 3, 90 ) )
  163. #error KDE 3.3
  164. #endif
  165. ],
  166. need_trinity3_compat="no"
  167. ,
  168. need_trinity3_compat="yes"
  169. )
  170. AC_COMPILE_IFELSE([
  171. #include <kdeversion.h>
  172. #if ! ( KDE_IS_VERSION( 3, 4, 90 ) )
  173. #error KDE 3.4
  174. #endif
  175. ],
  176. need_trinity4_compat="no"
  177. ,
  178. need_trinity4_compat="yes"
  179. )
  180. AC_COMPILE_IFELSE([
  181. #include <kdeversion.h>
  182. #if ! ( KDE_IS_VERSION( 3, 5, 2 ) )
  183. #error KDE 3.5.x (x < 2)
  184. #endif
  185. ],
  186. need_trinity51_compat="no"
  187. ,
  188. need_trinity51_compat="yes"
  189. )
  190. CXXFLAGS="$kdeversion_save_CXXFLAGS"
  191. LIBS="$kdeversion_safe_LIBS"
  192. AC_LANG_RESTORE
  193. if test "$need_trinity2_compat" = "yes"; then
  194. AC_MSG_RESULT([KDE 3.2.x])
  195. else
  196. if test "$need_trinity3_compat" = "yes"; then
  197. AC_MSG_RESULT([KDE 3.3.x])
  198. else
  199. if test "$need_trinity4_compat" = "yes"; then
  200. AC_MSG_RESULT([KDE 3.4.x])
  201. else
  202. if test "$need_trinity51_compat" = "yes"; then
  203. AC_MSG_RESULT([KDE 3.5.x (x < 2)])
  204. else
  205. AC_MSG_RESULT([KDE 3.5.x (x >=2) or SVN trunk])
  206. fi
  207. fi
  208. fi
  209. fi
  210. AM_CONDITIONAL(need_trinity2_compatibility, test "$need_trinity2_compat" = "yes")
  211. AM_CONDITIONAL(need_trinity3_compatibility, test "$need_trinity3_compat" = "yes")
  212. AM_CONDITIONAL(need_trinity4_compatibility, test "$need_trinity4_compat" = "yes")
  213. AM_CONDITIONAL(need_trinity51_compatibility, test "$need_trinity51_compat" = "yes")
  214. # Keep the old KDE 3.1 test, as long as it is still used
  215. AM_CONDITIONAL(need_trinity1_compatibility, test "supported" = "no")
  216. # --- End KDE 3.2 check ---
  217. # --- OpenEXR check ---
  218. KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
  219. AC_MSG_WARN([Could not find pkg-config])
  220. ])
  221. AC_MSG_CHECKING([for OpenEXR])
  222. if test -n "$PKGCONFIG"; then
  223. vers=`$PKGCONFIG OpenEXR --modversion 2>/dev/null`
  224. if test -n "$vers"
  225. then
  226. OPENEXR_LIBS="`$PKGCONFIG OpenEXR --libs`"
  227. OPENEXR_RPATH=
  228. for args in $OPENEXR_LIBS; do
  229. case $args in
  230. -L*)
  231. OPENEXR_RPATH="$OPENEXR_RPATH $args"
  232. ;;
  233. esac
  234. done
  235. OPENEXR_RPATH=`echo $OPENEXR_RPATH | $SED -e "s/-L/-R/g"`
  236. OPENEXR_CFLAGS="`$PKGCONFIG OpenEXR --cflags`"
  237. AC_DEFINE_UNQUOTED(HAVE_OPENEXR, 1, [Defines if your system has the OpenEXR library])
  238. fi
  239. fi
  240. if test ! "$USE_RPATH" = "yes"; then
  241. OPENEXR_RPATH=
  242. fi
  243. if test -n "$OPENEXR_LIBS"
  244. then
  245. AC_MSG_RESULT([yes])
  246. else
  247. AC_MSG_RESULT([not found])
  248. fi
  249. AC_SUBST(OPENEXR_LIBS)
  250. AC_SUBST(OPENEXR_CFLAGS)
  251. AC_SUBST(OPENEXR_RPATH)
  252. AM_CONDITIONAL(have_openexr, test -n "$OPENEXR_LIBS")
  253. # --- End of OpenEXR check ---