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.
 
 
 
 
 
 

374 lines
10 KiB

  1. AC_PREREQ(2.59)
  2. m4_define(xviewer_major_version, 1)
  3. m4_define(xviewer_minor_version, 4)
  4. m4_define(xviewer_micro_version, 3)
  5. m4_define(xviewer_version, xviewer_major_version.xviewer_minor_version.xviewer_micro_version)
  6. AC_INIT([xviewer], xviewer_version, [https://github.com/linuxmint/xviewer/issues], [xviewer])
  7. AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
  8. AC_CONFIG_MACRO_DIR([m4])
  9. # Support silencing the build output if supported (automake-1.11+)
  10. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  11. AC_DEFINE(XVIEWER_MAJOR_VERSION, xviewer_major_version, [XVIEWER major version])
  12. AC_SUBST(XVIEWER_MAJOR_VERSION, xviewer_major_version)
  13. AC_DEFINE(XVIEWER_MINOR_VERSION, xviewer_minor_version, [XVIEWER minor version])
  14. AC_SUBST(XVIEWER_MINOR_VERSION, xviewer_minor_version)
  15. AC_DEFINE(XVIEWER_MICRO_VERSION, xviewer_micro_version, [XVIEWER micro version])
  16. AC_SUBST(XVIEWER_MICRO_VERSION, xviewer_micro_version)
  17. XVIEWER_API_VERSION=3.0
  18. AC_SUBST(XVIEWER_API_VERSION)
  19. AC_CONFIG_HEADERS([config.h])
  20. AM_MAINTAINER_MODE([enable])
  21. GNOME_MAINTAINER_MODE_DEFINES
  22. GNOME_COMPILE_WARNINGS
  23. GNOME_DEBUG_CHECK
  24. # Disable building static archives by default
  25. LT_PREREQ([2.2.6])
  26. LT_INIT([disable-static])
  27. AC_PROG_CC
  28. AM_PROG_CC_C_O
  29. AC_PATH_PROG([GLIB_COMPILE_RESOURCES], [glib-compile-resources])
  30. AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
  31. AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
  32. PKG_PROG_PKG_CONFIG
  33. GTK_DOC_CHECK(1.16)
  34. AC_CHECK_FUNCS(strptime)
  35. # ****************************************************************
  36. # Support for nl_langinfo (_NL_MEASUREMENT_MEASUREMENT) (optional)
  37. # ****************************************************************
  38. AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
  39. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
  40. [[
  41. char c;
  42. c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));]])],
  43. [have_langinfo_measurement=yes], [have_langinfo_measurement=no])
  44. AC_MSG_RESULT($have_langinfo_measurement)
  45. if test "$have_langinfo_measurement" = "yes"; then
  46. AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
  47. [Define if _NL_MEASUREMENT_MEASUREMENT is available])
  48. fi
  49. # ***********
  50. # Translation
  51. # ***********
  52. AM_GLIB_GNU_GETTEXT
  53. IT_PROG_INTLTOOL([0.50.1])
  54. GETTEXT_PACKAGE=AC_PACKAGE_NAME
  55. AC_SUBST(GETTEXT_PACKAGE)
  56. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package.])
  57. AC_SUBST(CFLAGS)
  58. AC_SUBST(LDFLAGS)
  59. # ***************
  60. # User documentation
  61. # ***************
  62. YELP_HELP_INIT
  63. # **********
  64. # GNOME Libs
  65. # **********
  66. GTK_REQUIRED=3.10.0
  67. GLIB_REQUIRED=2.38.0
  68. GNOME_DESKTOP_REQUIRED=2.91.2
  69. GDKPIXBUF_REQUIRED=2.4.0
  70. GTK_PRINT_REQUIRED=3.5.4
  71. SHARED_MIME_INFO_REQUIRED=0.20
  72. EXEMPI_REQUIRED=1.99.5
  73. DESKTOP_SCHEMAS_REQUIRED=2.91.92
  74. LIBPEAS_REQUIRED=0.7.4
  75. LIBPEAS_GTK_REQUIRED=0.7.4
  76. XVIEWER_MODULES="gtk+-3.0 >= $GTK_REQUIRED \
  77. glib-2.0 >= $GLIB_REQUIRED \
  78. gio-2.0 >= $GLIB_REQUIRED \
  79. gio-unix-2.0 >= $GLIB_REQUIRED \
  80. gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED \
  81. gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED \
  82. gtk+-unix-print-3.0 >= $GTK_PRINT_REQUIRED \
  83. shared-mime-info >= $SHARED_MIME_INFO_REQUIRED \
  84. gsettings-desktop-schemas >= $DESKTOP_SCHEMAS_REQUIRED \
  85. libpeas-1.0 >= $LIBPEAS_REQUIRED \
  86. libpeas-gtk-1.0 >= $LIBPEAS_GTK_REQUIRED"
  87. # Introspection
  88. GOBJECT_INTROSPECTION_CHECK([0.9.3])
  89. if test "$found_introspection" = "yes"; then
  90. have_introspection=yes
  91. AC_DEFINE([HAVE_INTROSPECTION], [1], [Define to enable GObject Introspection])
  92. else
  93. have_introspection=no
  94. fi
  95. # ***************
  96. # libm (required)
  97. # ***************
  98. LT_LIB_M
  99. # ***************
  100. # ZLIB (required)
  101. # ***************
  102. have_zlib=yes
  103. AC_CHECK_HEADERS([zlib.h],
  104. [AC_CHECK_LIB([z], [inflate],
  105. [AC_CHECK_LIB([z], [crc32], [],
  106. [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], AS_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. if test "x$have_exif" = "xyes"; then
  121. AC_CHECK_HEADER([libexif/exif-data.h],[],[have_exif=no])
  122. fi
  123. fi
  124. if test "x$have_exif" = "xyes"; then
  125. AC_DEFINE(HAVE_EXIF, 1, [EXIF Support.])
  126. XVIEWER_MODULES="$XVIEWER_MODULES libexif >= $LIBEXIF_REQUIRED"
  127. fi
  128. AM_CONDITIONAL([HAVE_EXIF], [test "x$have_exif" = "xyes"])
  129. # *********************
  130. # Little CMS (optional)
  131. # *********************
  132. AC_ARG_WITH([cms], AS_HELP_STRING([--without-cms], [disable colour management support]))
  133. have_lcms=no
  134. if test x$with_cms != xno; then
  135. PKG_CHECK_MODULES(LCMS, lcms2, have_lcms=yes, have_lcms=no)
  136. fi
  137. if test "x$have_lcms" = "xyes"; then
  138. AC_DEFINE(HAVE_LCMS, 1, [Little CMS Support.])
  139. XVIEWER_MODULES="$XVIEWER_MODULES lcms2"
  140. fi
  141. AM_CONDITIONAL([HAVE_LCMS], [test "x$have_lcms" = "xyes"])
  142. # *********************
  143. # Exempi (optional)
  144. # *********************
  145. AC_ARG_WITH(xmp, AS_HELP_STRING([--without-xmp], [disable special XMP support]))
  146. have_exempi=no
  147. if test x$with_xmp != xno; then
  148. PKG_CHECK_MODULES(EXEMPI, exempi-2.0 >= $EXEMPI_REQUIRED, have_exempi=yes, have_exempi=no)
  149. fi
  150. if test "x$have_exempi" = "xyes"; then
  151. AC_DEFINE(HAVE_EXEMPI,1, [XMP support.])
  152. XVIEWER_MODULES="$XVIEWER_MODULES exempi-2.0 >= $EXEMPI_REQUIRED"
  153. fi
  154. AM_CONDITIONAL([HAVE_EXEMPI], [test "x$have_exempi" = "xyes"])
  155. # Build EXIF-related documentation if we really have support for it
  156. if test "x$have_exif" = "xyes" || test "x$have_exempi" = "xyes"; then
  157. XVIEWER_DOC_EXIF_START=""
  158. XVIEWER_DOC_EXIF_STOP=""
  159. else
  160. XVIEWER_DOC_EXIF_START="<!--"
  161. XVIEWER_DOC_EXIF_STOP="-->"
  162. fi
  163. AC_SUBST([XVIEWER_DOC_EXIF_START])
  164. AC_SUBST([XVIEWER_DOC_EXIF_STOP])
  165. # ********************
  166. # Jpeg (semi-optional)
  167. # ********************
  168. AC_ARG_WITH(libjpeg, AS_HELP_STRING([--without-libjpeg], [disable special JPEG support]))
  169. have_jpeg=no
  170. have_libjpeg_80=no
  171. if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
  172. AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
  173. have_jpeg=yes,
  174. have_jpeg=no
  175. AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
  176. if test "$have_jpeg" = yes; then
  177. AC_MSG_CHECKING([for jpeglib.h])
  178. AC_PREPROC_IFELSE([AC_LANG_SOURCE(
  179. [[
  180. #include <stdio.h>
  181. #undef PACKAGE
  182. #undef VERSION
  183. #undef HAVE_STDLIB_H
  184. #include <jpeglib.h>
  185. ]])],
  186. [have_jpeg=yes], [have_jpeg=no])
  187. AC_MSG_RESULT($have_jpeg)
  188. if test "$have_jpeg" = "yes"; then
  189. LIBJPEG='-ljpeg'
  190. AC_DEFINE(HAVE_JPEG, 1, [Jpeg Support.])
  191. AC_DEFINE(HAVE_LIBJPEG, 1, [libjpeg is Present.])
  192. AC_CHECK_LIB(jpeg, jpeg_simple_progression,
  193. AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, [Jpeg Progressive Saving Support.]),
  194. AC_MSG_WARN(JPEG library does not support progressive saving.))
  195. AC_MSG_CHECKING([[libjpeg version is 8 or greater]])
  196. AC_PREPROC_IFELSE([ AC_LANG_SOURCE(
  197. [[
  198. #include <stdio.h>
  199. #include <jpeglib.h>
  200. #if JPEG_LIB_VERSION < 80
  201. #error "wrong version"
  202. #endif ]])],
  203. [AC_MSG_RESULT(yes)
  204. have_libjpeg_80=yes],
  205. [AC_MSG_RESULT(no)
  206. have_libjpeg_80=no])
  207. else
  208. AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
  209. fi
  210. fi
  211. fi
  212. if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
  213. AC_MSG_ERROR([
  214. *** Checks for JPEG loader failed. You can build without it by passing
  215. *** --without-libjpeg to configure but some programs using GTK+ may
  216. *** not work properly])
  217. fi
  218. AC_SUBST(LIBJPEG)
  219. AM_CONDITIONAL(ENABLE_JPEG, test x$have_jpeg = xyes)
  220. AM_CONDITIONAL(HAVE_LIBJPEG_80, test "x$have_libjpeg_80" = xyes)
  221. # ************************************
  222. # libXML2 (required for toolbareditor)
  223. # ************************************
  224. LIBXML2_REQUIRED=2.0
  225. PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= $LIBXML2_REQUIRED])
  226. # ***************
  227. # RSVG (optional for scaling svg image)
  228. # ***************
  229. LIBRSVG_REQUIRED=2.36.2
  230. AC_ARG_WITH([librsvg], AS_HELP_STRING([--without-librsvg], [disable RSVG support]))
  231. have_rsvg=no
  232. if test x$with_librsvg != xno; then
  233. PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= $LIBRSVG_REQUIRED, have_rsvg=yes, have_rsvg=no)
  234. fi
  235. if test "x$have_rsvg" = "xyes"; then
  236. AC_DEFINE(HAVE_RSVG, 1, [RSVG Support.])
  237. XVIEWER_MODULES="$XVIEWER_MODULES librsvg-2.0 >= $LIBRSVG_REQUIRED"
  238. fi
  239. AM_CONDITIONAL([HAVE_RSVG], [test "x$have_rsvg" = "xyes"])
  240. # ****************
  241. # CFLAGS/LIBS init
  242. # ****************
  243. PKG_CHECK_MODULES(XVIEWER, $XVIEWER_MODULES)
  244. AC_SUBST(XVIEWER_CFLAGS)
  245. AC_SUBST(XVIEWER_LIBS)
  246. # *******************************************************
  247. # libX11 (required for TotemScrSaver and Color Profiling)
  248. # *******************************************************
  249. # Check GDK rendering target
  250. gdk_target=`$PKG_CONFIG --variable=targets gdk-3.0`
  251. if test "x$have_lcms" = "xyes" || test "$gdk_target" = "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. # ***************
  270. # Installed tests
  271. # ***************
  272. BEHAVE_INSTALLED_TESTS
  273. AC_CONFIG_FILES([
  274. Makefile
  275. src/Makefile
  276. jpegutils/Makefile
  277. cut-n-paste/Makefile
  278. cut-n-paste/toolbar-editor/Makefile
  279. help/Makefile
  280. po/Makefile.in
  281. data/Makefile
  282. data/xviewer.pc
  283. data/xviewer.desktop.in
  284. data/org.x.viewer.gschema.xml
  285. data/pixmaps/Makefile
  286. data/icons/Makefile
  287. data/icons/16x16/Makefile
  288. data/icons/22x22/Makefile
  289. data/icons/24x24/Makefile
  290. data/icons/32x32/Makefile
  291. data/icons/48x48/Makefile
  292. data/icons/scalable/Makefile
  293. doc/Makefile
  294. doc/reference/Makefile
  295. doc/reference/version.xml
  296. doc/reference/xviewer-docs.xml
  297. ])
  298. AC_OUTPUT
  299. echo "
  300. Configure summary:
  301. Source code location .......: ${srcdir}
  302. Compiler ...................: ${CC}
  303. Extra Compiler Warnings ....: ${WARN_CFLAGS}
  304. EXIF support ...............: ${have_exif}
  305. XMP support ................: ${have_exempi}
  306. JPEG support ...............: ${have_jpeg}
  307. Colour management support ..: ${have_lcms}
  308. GObject Introspection.......: ${have_introspection}
  309. "