KOffice – TDE office suite
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

configure.in.in 8.9KB

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