configure.ac 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. AC_PREREQ(2.59)
  2. AC_CONFIG_MACRO_DIR([m4])
  3. m4_define(gdk-pixbuf_minver, 2.36.5)
  4. m4_define(eom_major_version, 1)
  5. m4_define(eom_minor_version, 22)
  6. m4_define(eom_micro_version, 2)
  7. m4_define(eom_version, eom_major_version.eom_minor_version.eom_micro_version)
  8. AC_INIT([eom], eom_version, [http://www.mate-desktop.org], [eom])
  9. AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-xz check-news])
  10. # Support silencing the build output if supported (automake-1.11+)
  11. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  12. AC_DEFINE(EOM_MAJOR_VERSION, eom_major_version, [EOM major version])
  13. AC_SUBST(EOM_MAJOR_VERSION, eom_major_version)
  14. AC_DEFINE(EOM_MINOR_VERSION, eom_minor_version, [EOM minor version])
  15. AC_SUBST(EOM_MINOR_VERSION, eom_minor_version)
  16. AC_DEFINE(EOM_MICRO_VERSION, eom_micro_version, [EOM micro version])
  17. AC_SUBST(EOM_MICRO_VERSION, eom_micro_version)
  18. EOM_API_VERSION=2.20
  19. AC_SUBST(EOM_API_VERSION)
  20. AC_CONFIG_HEADERS([config.h])
  21. AM_MAINTAINER_MODE
  22. AC_SUBST(GDKPIXBUF_REQUIRED, [gdk-pixbuf_minver])
  23. MATE_COMMON_INIT
  24. MATE_MAINTAINER_MODE_DEFINES
  25. MATE_COMPILE_WARNINGS
  26. MATE_DEBUG_CHECK
  27. # Disable building static archives by default
  28. AC_DISABLE_STATIC
  29. AC_PROG_LIBTOOL
  30. AC_PROG_CC
  31. AM_PROG_CC_C_O
  32. AC_PATH_PROG([GLIB_COMPILE_RESOURCES], [glib-compile-resources])
  33. AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
  34. AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
  35. GTK_DOC_CHECK(1.9)
  36. AC_CHECK_FUNCS(strptime)
  37. # ****************************************************************
  38. # Support for nl_langinfo (_NL_MEASUREMENT_MEASUREMENT) (optional)
  39. # ****************************************************************
  40. AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
  41. AC_TRY_LINK([#include <langinfo.h>], [
  42. char c;
  43. c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
  44. ], have_langinfo_measurement=yes, have_langinfo_measurement=no)
  45. AC_MSG_RESULT($have_langinfo_measurement)
  46. if test "$have_langinfo_measurement" = "yes"; then
  47. AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
  48. [Define if _NL_MEASUREMENT_MEASUREMENT is available])
  49. fi
  50. # ***********
  51. # Translation
  52. # ***********
  53. AM_GLIB_GNU_GETTEXT
  54. IT_PROG_INTLTOOL([0.50.1])
  55. GETTEXT_PACKAGE=AC_PACKAGE_NAME
  56. AC_SUBST(GETTEXT_PACKAGE)
  57. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package.])
  58. AC_SUBST(CFLAGS)
  59. AC_SUBST(LDFLAGS)
  60. # ***************
  61. # mate-doc-utils
  62. # ***************
  63. PKG_PROG_PKG_CONFIG
  64. YELP_HELP_INIT
  65. # **********
  66. # MATE Libs
  67. # **********
  68. GLIB_REQUIRED=2.52.0
  69. GIO_REQUIRED=2.50.0
  70. GTK_REQUIRED=3.22.0
  71. MATE_DESKTOP_REQUIRED=1.17.0
  72. GDKPIXBUF_REQUIRED=2.30.0
  73. SHARED_MIME_INFO_REQUIRED=0.20
  74. EXEMPI_REQUIRED=1.99.5
  75. LIBPEAS_REQUIRED=1.8.0
  76. PKG_CHECK_MODULES(GMODULE, gmodule-2.0, [GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""])
  77. EOM_MODULES="gtk+-3.0 >= $GTK_REQUIRED \
  78. gdk-pixbuf-2.0 >= gdk-pixbuf_minver
  79. glib-2.0 >= $GLIB_REQUIRED \
  80. $GMODULE_ADD \
  81. gio-2.0 >= $GLIB_REQUIRED \
  82. gio-unix-2.0 >= $GLIB_REQUIRED \
  83. gthread-2.0 >= $GLIB_REQUIRED \
  84. mate-desktop-2.0 >= $MATE_DESKTOP_REQUIRED \
  85. gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED \
  86. gio-2.0 >= $GIO_REQUIRED \
  87. gtk+-unix-print-3.0 >= $GTK_REQUIRED \
  88. shared-mime-info >= $SHARED_MIME_INFO_REQUIRED \
  89. libpeas-1.0 >= $LIBPEAS_REQUIRED \
  90. libpeas-gtk-1.0 >= $LIBPEAS_REQUIRED"
  91. # Introspection
  92. GOBJECT_INTROSPECTION_CHECK([0.9.3])
  93. if test "$found_introspection" = "yes"; then
  94. have_introspection=yes
  95. AC_DEFINE([HAVE_INTROSPECTION], [1], [Define to enable GObject Introspection])
  96. else
  97. have_introspection=no
  98. fi
  99. AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$have_introspection" = xyes)
  100. # ***************
  101. # ZLIB (required)
  102. # ***************
  103. have_zlib=yes
  104. AC_CHECK_HEADERS([zlib.h],
  105. [AC_CHECK_LIB([z], [inflate],
  106. [AC_CHECK_LIB([z], [crc32], [], [have_zlib=no])],
  107. [have_zlib=no])],
  108. [have_zlib=no])
  109. if test x$have_zlib = xno; then
  110. AC_MSG_ERROR([No sufficient zlib library found on your system.])
  111. fi
  112. # ***************
  113. # EXIF (optional)
  114. # ***************
  115. LIBEXIF_REQUIRED=0.6.14
  116. AC_ARG_WITH([libexif], AC_HELP_STRING([--without-libexif], [disable EXIF support]))
  117. have_exif=no
  118. if test x$with_libexif != xno; then
  119. PKG_CHECK_MODULES(EXIF, libexif >= $LIBEXIF_REQUIRED, have_exif=yes, have_exif=no)
  120. fi
  121. if test "x$have_exif" = "xyes"; then
  122. AC_DEFINE(HAVE_EXIF, 1, [EXIF Support.])
  123. EOM_MODULES="$EOM_MODULES libexif >= $LIBEXIF_REQUIRED"
  124. fi
  125. AM_CONDITIONAL([HAVE_EXIF], [test "x$have_exif" = "xyes"])
  126. # *********************
  127. # Little CMS (optional)
  128. # *********************
  129. AC_ARG_WITH([cms], AC_HELP_STRING([--without-cms], [disable colour management support]))
  130. have_lcms=no
  131. if test x$with_cms != xno; then
  132. PKG_CHECK_MODULES(LCMS, lcms2, have_lcms=yes, have_lcms=no)
  133. fi
  134. if test "x$have_lcms" = "xyes"; then
  135. AC_DEFINE(HAVE_LCMS, 1, [Little CMS Support.])
  136. EOM_MODULES="$EOM_MODULES lcms2"
  137. fi
  138. AM_CONDITIONAL([HAVE_LCMS], [test "x$have_lcms" = "xyes"])
  139. # *********************
  140. # Exempi (optional)
  141. # *********************
  142. AC_ARG_WITH(xmp, AC_HELP_STRING([--without-xmp], [disable special XMP support]))
  143. have_exempi=no
  144. if test x$with_xmp != xno; then
  145. PKG_CHECK_MODULES(EXEMPI, exempi-2.0 >= $EXEMPI_REQUIRED, have_exempi=yes, have_exempi=no)
  146. fi
  147. if test "x$have_exempi" = "xyes"; then
  148. AC_DEFINE(HAVE_EXEMPI,1, [XMP support.])
  149. EOM_MODULES="$EOM_MODULES exempi-2.0 >= $EXEMPI_REQUIRED"
  150. fi
  151. AM_CONDITIONAL([HAVE_EXEMPI], [test "x$have_exempi" = "xyes"])
  152. # Build EXIF-related documentation if we really have support for it
  153. if test "x$have_exif" = "xyes" || test "x$have_exempi" = "xyes"; then
  154. EOM_DOC_EXIF_START=""
  155. EOM_DOC_EXIF_STOP=""
  156. else
  157. EOM_DOC_EXIF_START="<!--"
  158. EOM_DOC_EXIF_STOP="-->"
  159. fi
  160. AC_SUBST([EOM_DOC_EXIF_START])
  161. AC_SUBST([EOM_DOC_EXIF_STOP])
  162. # ********************
  163. # Jpeg (semi-optional)
  164. # ********************
  165. AC_ARG_WITH(libjpeg, AC_HELP_STRING([--without-libjpeg], [disable special JPEG support]))
  166. have_jpeg=no
  167. have_libjpeg_80=no
  168. if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
  169. AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
  170. have_jpeg=yes,
  171. have_jpeg=no
  172. AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
  173. if test "$have_jpeg" = yes; then
  174. AC_MSG_CHECKING([for jpeglib.h])
  175. AC_TRY_CPP(
  176. [#include <stdio.h>
  177. #undef PACKAGE
  178. #undef VERSION
  179. #undef HAVE_STDLIB_H
  180. #include <jpeglib.h>],
  181. have_jpeg=yes,
  182. have_jpeg=no)
  183. AC_MSG_RESULT($have_jpeg)
  184. if test "$have_jpeg" = yes; then
  185. LIBJPEG='-ljpeg'
  186. AC_DEFINE(HAVE_JPEG, 1, [Jpeg Support.])
  187. AC_DEFINE(HAVE_LIBJPEG, 1, [libjpeg is Present.])
  188. AC_CHECK_LIB(jpeg, jpeg_simple_progression,
  189. AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, [Jpeg Progressive Saving Support.]),
  190. AC_MSG_WARN(JPEG library does not support progressive saving.))
  191. AC_MSG_CHECKING([[libjpeg version is 8 or greater]])
  192. AC_PREPROC_IFELSE([ AC_LANG_SOURCE(
  193. [[
  194. #include <stdio.h>
  195. #include <jpeglib.h>
  196. #if JPEG_LIB_VERSION < 80
  197. #error "wrong version"
  198. #endif
  199. int main(int c, char**v) { return 0; }
  200. ]]) ],
  201. [AC_MSG_RESULT(yes)
  202. have_libjpeg_80=yes],
  203. [AC_MSG_RESULT(no)
  204. have_libjpeg_80=no])
  205. else
  206. AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
  207. fi
  208. fi
  209. fi
  210. if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
  211. AC_MSG_ERROR([
  212. *** Checks for JPEG loader failed. You can build without it by passing
  213. *** --without-libjpeg to configure but some programs using GTK+ may
  214. *** not work properly])
  215. fi
  216. AC_SUBST(LIBJPEG)
  217. AM_CONDITIONAL(ENABLE_JPEG, test x$have_jpeg = xyes)
  218. AM_CONDITIONAL(HAVE_LIBJPEG_80, test "x$have_libjpeg_80" = xyes)
  219. # ************************************
  220. # libXML2 (required for toolbareditor)
  221. # ************************************
  222. LIBXML2_REQUIRED=2.0
  223. PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= $LIBXML2_REQUIRED])
  224. # ***************
  225. # RSVG (optional for scaling svg image)
  226. # ***************
  227. LIBRSVG_REQUIRED=2.36.2
  228. AC_ARG_WITH([librsvg], AC_HELP_STRING([--without-librsvg], [disable RSVG support]))
  229. have_rsvg=no
  230. if test x$with_librsvg != xno; then
  231. PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= $LIBRSVG_REQUIRED, have_rsvg=yes, have_rsvg=no)
  232. fi
  233. if test "x$have_rsvg" = "xyes"; then
  234. AC_DEFINE(HAVE_RSVG, 1, [RSVG Support.])
  235. EOM_MODULES="$EOM_MODULES librsvg-2.0 >= $LIBRSVG_REQUIRED"
  236. else
  237. AC_WARN([LIBRSVG support disabled, svg files will not scale])
  238. fi
  239. AM_CONDITIONAL([HAVE_RSVG], [test "x$have_rsvg" = "xyes"])
  240. # ****************
  241. # CFLAGS/LIBS init
  242. # ****************
  243. PKG_CHECK_MODULES(EOM, $EOM_MODULES)
  244. AC_SUBST(EOM_CFLAGS)
  245. AC_SUBST(EOM_LIBS)
  246. # *******************************************************
  247. # libX11 (required for TotemScrSaver and Color Profiling)
  248. # *******************************************************
  249. # Check GDK rendering target
  250. gdk_target_has_x11=`$PKG_CONFIG --variable=targets gdk-3.0 | grep x11`
  251. if test "x$have_lcms" = "xyes" || test "$gdk_target_has_x11" != ""; then
  252. PKG_CHECK_MODULES(X11, [x11], have_x11=yes, have_x11=no)
  253. if test "x$have_x11" != "xyes"; then
  254. # Fallback for X11 releases without .pc-files
  255. AC_PATH_XTRA
  256. if test x$no_x = xyes ; then
  257. AC_MSG_ERROR([X development libraries (libX11) not found])
  258. else
  259. X11_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
  260. AC_SUBST(X11_LIBS)
  261. have_x11=yes
  262. fi
  263. fi
  264. fi
  265. # *****
  266. # GSettings
  267. # *****
  268. GLIB_GSETTINGS
  269. AC_SEARCH_LIBS([floor],[m])
  270. AC_CONFIG_FILES([
  271. Makefile
  272. src/Makefile
  273. man/Makefile
  274. jpegutils/Makefile
  275. cut-n-paste/Makefile
  276. cut-n-paste/toolbar-editor/Makefile
  277. help/Makefile
  278. po/Makefile.in
  279. data/Makefile
  280. data/eom.pc
  281. data/eom.desktop.in
  282. data/org.mate.eom.gschema.xml
  283. data/pixmaps/Makefile
  284. data/icons/Makefile
  285. data/icons/16x16/Makefile
  286. data/icons/22x22/Makefile
  287. data/icons/24x24/Makefile
  288. data/icons/32x32/Makefile
  289. data/icons/48x48/Makefile
  290. data/icons/scalable/Makefile
  291. doc/Makefile
  292. doc/reference/Makefile
  293. doc/reference/version.xml
  294. doc/reference/eom-docs.sgml
  295. plugins/Makefile
  296. ])
  297. AC_OUTPUT
  298. echo "
  299. Configure summary:
  300. Source code location .......: ${srcdir}
  301. Compiler ...................: ${CC}
  302. Extra Compiler Warnings ....: ${WARN_CFLAGS}
  303. EXIF support ...............: ${have_exif}
  304. XMP support ................: ${have_exempi}
  305. JPEG support ...............: ${have_jpeg}
  306. RSVG support ...............: ${have_rsvg}
  307. Colour management support ..: ${have_lcms}
  308. GObject Introspection.......: ${have_introspection}
  309. "