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.
 
 
 
 
 
 

772 lines
25 KiB

  1. # *****************************************************************************
  2. # Versioning
  3. # *****************************************************************************
  4. m4_define([ev_major_version], [1])
  5. m4_define([ev_minor_version], [4])
  6. m4_define([ev_micro_version], [4])
  7. m4_define([ev_extra_version], [])
  8. m4_define([ev_version], [ev_major_version.ev_minor_version.ev_micro_version()ev_extra_version])
  9. # The xreader API version
  10. m4_define([ev_api_version], [1.5.0])
  11. # Libtool versioning. The backend and view libraries have separate versions.
  12. # Before making a release, the libtool version should be modified.
  13. # The string is of the form C:R:A.
  14. # - If interfaces have been changed or added, but binary compatibility has
  15. # been preserved, change to C+1:0:A+1
  16. # - If binary compatibility has been broken (eg removed or changed interfaces)
  17. # change to C+1:0:0
  18. # - If the interface is the same as the previous version, change to C:R+1:A
  19. # Libtool version of the backend library
  20. m4_define([ev_document_lt_current], [3])
  21. m4_define([ev_document_lt_revision], [0])
  22. m4_define([ev_document_lt_age], [0])
  23. m4_define([ev_document_lt_version_info], [ev_document_lt_current:ev_document_lt_revision:ev_document_lt_age])
  24. m4_define([ev_document_lt_current_minus_age], [m4_eval(ev_document_lt_current - ev_document_lt_age)])
  25. # Libtool version of the view library
  26. m4_define([ev_view_lt_current], [3])
  27. m4_define([ev_view_lt_revision], [0])
  28. m4_define([ev_view_lt_age], [0])
  29. m4_define([ev_view_lt_version_info], [ev_view_lt_current:ev_view_lt_revision:ev_view_lt_age])
  30. m4_define([ev_view_lt_current_minus_age], [m4_eval(ev_view_lt_current - ev_view_lt_age)])
  31. # Binary version for the document backends
  32. m4_define([ev_binary_version], [ev_document_lt_current])
  33. # *****************************************************************************
  34. AC_PREREQ([2.57])
  35. AC_INIT([xreader], [ev_version], [https://github.com/linuxmint/xreader/issues], [xreader])
  36. AM_INIT_AUTOMAKE([1.10 foreign tar-ustar dist-xz no-dist-gzip check-news])
  37. AC_CONFIG_HEADERS([config.h])
  38. AC_CONFIG_MACRO_DIR([m4])
  39. if test -z "$enable_maintainer_mode"; then
  40. enable_maintainer_mode=yes
  41. fi
  42. AM_MAINTAINER_MODE([enable])
  43. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  44. AC_PROG_CC
  45. AM_PROG_CC_C_O
  46. AC_PROG_CXX
  47. AC_STDC_HEADERS
  48. AM_PROG_LIBTOOL
  49. AC_PROG_SED
  50. AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
  51. AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
  52. MATE_MAINTAINER_MODE_DEFINES
  53. MATE_COMPILE_WARNINGS
  54. MATE_CXX_WARNINGS
  55. DISABLE_DEPRECATED=
  56. AC_SUBST([DISABLE_DEPRECATED])
  57. IT_PROG_INTLTOOL([0.50.1])
  58. GETTEXT_PACKAGE=xreader
  59. AC_SUBST(GETTEXT_PACKAGE)
  60. AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext package])
  61. AM_GLIB_GNU_GETTEXT
  62. m4_pattern_allow([AM_V_GEN])dnl Make autoconf not complain about the rule below
  63. EV_INTLTOOL_XREADER_BACKEND_RULE='%.xreader-backend: %.xreader-backend.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(AM_V_GEN) LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
  64. AC_SUBST([EV_INTLTOOL_XREADER_BACKEND_RULE])
  65. GLIB_GSETTINGS
  66. dnl Specify required versions of dependencies
  67. CAIRO_REQUIRED=1.14.0
  68. GLIB_REQUIRED=2.36.0
  69. GTK_API_VERSION=3.0
  70. WEBKIT_API_VERSION=4.0
  71. GAIL_API_VERSION=-3.0
  72. GTK_REQUIRED=3.14.0
  73. WEBKIT_REQUIRED=2.4.3
  74. LIBSECRET_REQUIRED=0.5
  75. LIBXML_REQUIRED=2.5.0
  76. AC_SUBST([GLIB_REQUIRED])
  77. AC_SUBST([GTK_REQUIRED])
  78. AC_SUBST([GTK_API_VERSION])
  79. dnl Check dependencies
  80. # LIB_CFLAGS for helpers and generic widgets. (libdocument, cut-and-paste)
  81. # BACKEND_CFLAGS for backend implementations.
  82. # FRONTEND_CFLAGS for frontend implementations. (properties, thumbnailer)
  83. # FRONTEND_LIBS
  84. # SHELL_CFLAGS for shell implementation.
  85. # SHELL_LIBS
  86. AC_SEARCH_LIBS([hypot],[m])
  87. PKG_CHECK_MODULES(LIBDOCUMENT, gtk+-3.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
  88. PKG_CHECK_MODULES(LIBVIEW, gtk+-3.0 >= $GTK_REQUIRED gail$GAIL_API_VERSION >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
  89. PKG_CHECK_MODULES(BACKEND, cairo >= $CAIRO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED)
  90. PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
  91. PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
  92. PKG_CHECK_MODULES([SHELL_CORE],[libxml-2.0 >= $LIBXML_REQUIRED gtk+-3.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gthread-2.0 x11])
  93. dnl
  94. dnl zlib support
  95. dnl
  96. PKG_CHECK_MODULES([ZLIB], [zlib], [found_zlib=yes], [found_zlib=no])
  97. AS_IF([test "x$found_zlib" = "xno"], [
  98. AC_CHECK_LIB(z, inflate, [AC_CHECK_HEADER(zlib.h, found_zlib=yes)])
  99. if test "x$found_zlib" = "xno" ; then
  100. AC_MSG_ERROR([*** Working zlib library and headers not found ***])
  101. fi
  102. ZLIB_LIBS='-lz'
  103. AC_SUBST(ZLIB_LIBS)
  104. ])
  105. dnl
  106. dnl SM client
  107. dnl
  108. PKG_CHECK_MODULES([SMCLIENT],[gtk+-3.0 gthread-2.0 sm >= 1.0.0])
  109. AC_SUBST([SMCLIENT_CFLAGS])
  110. AC_SUBST([SMCLIENT_LIBS])
  111. # ***
  112. BACKEND_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -export-symbols \$(top_srcdir)/backend/backend.symbols"
  113. AC_SUBST(BACKEND_LIBTOOL_FLAGS)
  114. # ******************
  115. # GKT+ Unix Printing
  116. # ******************
  117. AC_MSG_CHECKING([whether gtk+-unix-print support is requested])
  118. AC_ARG_WITH([gtk-unix-print],
  119. [AS_HELP_STRING([--without-gtk-unix-print],
  120. [Disable the use of gtk-unix-print])],
  121. [],[with_gtk_unix_print=yes])
  122. AC_MSG_RESULT([$with_gtk_unix_print])
  123. if test "$with_gtk_unix_print" = "yes"; then
  124. PKG_CHECK_MODULES(GTKUNIXPRINT, [gtk+-unix-print-3.0 >= $GTK_REQUIRED])
  125. AC_DEFINE([GTKUNIXPRINT_ENABLED], [1], [Define if gtk+-unix-print is enabled.])
  126. fi
  127. # *********************
  128. # Keyring support
  129. # *********************
  130. AC_ARG_WITH(keyring,
  131. [AS_HELP_STRING([--without-keyring],
  132. [Disable the use of libsecret and keyring])],
  133. [],
  134. [with_keyring=yes])
  135. AM_CONDITIONAL([WITH_KEYRING],[test "$with_keyring" = "yes"])
  136. if test "$with_keyring" = "yes"; then
  137. PKG_CHECK_MODULES(LIBSECRET, libsecret-1 >= $LIBSECRET_REQUIRED)
  138. AC_DEFINE([WITH_KEYRING],[1],[Define if KEYRING support is enabled])
  139. fi
  140. # ****
  141. # DBUS
  142. # ****
  143. AC_ARG_ENABLE([dbus],
  144. [AS_HELP_STRING([--disable-dbus], [Disable support for dbus])],
  145. [],
  146. [enable_dbus=yes])
  147. if test "$enable_dbus" = "yes"; then
  148. AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
  149. PKG_CHECK_MODULES([EV_DAEMON], [gio-2.0 >= $GLIB_REQUIRED])
  150. fi
  151. AM_CONDITIONAL([ENABLE_DBUS], [test "$enable_dbus" = "yes"])
  152. dnl Debug mode
  153. AC_ARG_ENABLE([debug],
  154. AS_HELP_STRING([--enable-debug],
  155. [Turn on xreader debug mode]),
  156. [enable_debug=$enableval],
  157. [enable_debug=no])
  158. if test "x$enable_debug" = "xyes"; then
  159. DEBUG_FLAGS="-DEV_ENABLE_DEBUG"
  160. fi
  161. AC_ARG_ENABLE([tests],
  162. AS_HELP_STRING([--enable-tests], [Enable the tests]),
  163. [enable_tests=$enableval],
  164. [enable_tests=yes])
  165. AM_CONDITIONAL(ENABLE_TESTS, test x$enable_tests = xyes)
  166. LIBDOCUMENT_CFLAGS="$LIBDOCUMENT_CFLAGS $DEBUG_FLAGS"
  167. LIBDOCUMENT_LIBS="$LIBDOCUMENT_LIBS"
  168. AC_SUBST(LIBDOCUMENT_CFLAGS)
  169. AC_SUBST(LIBDOCUMENT_LIBS)
  170. LIBVIEW_CFLAGS="$LIBVIEW_CFLAGS $GTKUNIXPRINT_CFLAGS $DEBUG_FLAGS"
  171. LIBVIEW_LIBS="$LIBVIEW_LIBS $GTKUNIXPRINT_LIBS -lm"
  172. AC_SUBST(LIBVIEW_CFLAGS)
  173. AC_SUBST(LIBVIEW_LIBS)
  174. BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
  175. BACKEND_LIBS="$BACKEND_LIBS -lm"
  176. AC_SUBST(BACKEND_CFLAGS)
  177. AC_SUBST(BACKEND_LIBS)
  178. SHELL_CFLAGS="$SHELL_CORE_CFLAGS $LIBSECRET_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
  179. SHELL_LIBS="$SHELL_CORE_LIBS $LIBSECRET_LIBS -lz -lm"
  180. AC_SUBST(SHELL_CFLAGS)
  181. AC_SUBST(SHELL_LIBS)
  182. FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS $DEBUG_FLAGS"
  183. FRONTEND_LIBS="$FRONTEND_CORE_LIBS -lz"
  184. AC_SUBST(FRONTEND_CFLAGS)
  185. AC_SUBST(FRONTEND_LIBS)
  186. EV_DAEMON_CFLAGS="$EV_DAEMON_CFLAGS $DEBUG_FLAGS"
  187. AC_SUBST([EV_DAEMON_CFLAGS])
  188. AC_SUBST([EV_DAEMON_LIBS])
  189. # Check for Caja property page build
  190. AC_ARG_ENABLE([caja],
  191. [AS_HELP_STRING([--disable-caja],
  192. [Disable build of caja extensions])],
  193. [],
  194. [enable_caja=yes])
  195. if test "$enable_caja" = "yes" ; then
  196. PKG_CHECK_MODULES([CAJA],[$MM gthread-2.0 libcaja-extension >= 1.17.1],
  197. [],[AC_MSG_ERROR([libcaja-extension not found; use --disable-caja to disable the caja extensions])])
  198. CAJA_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libcaja-extension`
  199. AC_SUBST([cajaextensiondir],[$CAJA_EXTENSION_DIR])
  200. AC_SUBST(CAJA_CFLAGS)
  201. AC_SUBST(CAJA_LIBS)
  202. AC_DEFINE([HAVE_CAJA],[1], [defined if you build the caja plugin])
  203. fi
  204. AM_CONDITIONAL([ENABLE_CAJA],[test "$enable_caja" = "yes"])
  205. # Check for Nemo property page build
  206. AC_ARG_ENABLE([nemo],
  207. [AS_HELP_STRING([--disable-nemo],
  208. [Disable build of nemo extensions])],
  209. [],
  210. [enable_nemo=yes])
  211. if test "$enable_nemo" = "yes" ; then
  212. PKG_CHECK_MODULES([NEMO],[$MM gthread-2.0 libnemo-extension],
  213. [],[AC_MSG_ERROR([libnemo-extension not found; use --disable-nemo to disable the nemo extensions])])
  214. NEMO_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnemo-extension`
  215. AC_SUBST([nemoextensiondir],[$NEMO_EXTENSION_DIR])
  216. AC_SUBST(NEMO_CFLAGS)
  217. AC_SUBST(NEMO_LIBS)
  218. AC_DEFINE([HAVE_NEMO],[1], [defined if you build the nemo plugin])
  219. fi
  220. AM_CONDITIONAL([ENABLE_NEMO],[test "$enable_nemo" = "yes"])
  221. # Check for thumbnailer build
  222. AC_ARG_ENABLE([thumbnailer],
  223. [AS_HELP_STRING([--disable-thumbnailer],
  224. [Disable MATE thumbnailer])],
  225. [],
  226. [enable_thumbnailer=yes])
  227. AM_CONDITIONAL([ENABLE_THUMBNAILER],[test "$enable_thumbnailer" = "yes"])
  228. # ***************
  229. # Print Previewer
  230. # ***************
  231. AC_ARG_ENABLE([previewer],
  232. [AS_HELP_STRING([--disable-previewer],
  233. [Disable the MATE Document Previewer])],
  234. [],
  235. [enable_previewer=yes])
  236. if test x$enable_previewer = "xyes" ; then
  237. PKG_CHECK_MODULES([PREVIEWER],[gtk+-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED])
  238. fi
  239. AM_CONDITIONAL([ENABLE_PREVIEWER],[test "$enable_previewer" = "yes"])
  240. PREVIEWER_CFLAGS="$PREVIEWER_CFLAGS $GTKUNIXPRINT_CFLAGS $DEBUG_FLAGS"
  241. PREVIEWER_LIBS="$PREVIEWER_LIBS $GTKUNIXPRINT_LIBS -lz"
  242. AC_SUBST(PREVIEWER_CFLAGS)
  243. AC_SUBST(PREVIEWER_LIBS)
  244. # ***
  245. # GIR
  246. # ***
  247. AC_MSG_CHECKING([whether GObject introspection is requested])
  248. AC_ARG_ENABLE([introspection],
  249. AS_HELP_STRING([--enable-introspection],
  250. [Enable GObject introspection]),
  251. [enable_introspection=$enableval],
  252. [enable_introspection=no])
  253. AC_MSG_RESULT([$enable_introspection])
  254. G_IR_SCANNER=
  255. G_IR_COMPILER=
  256. G_IR_GENERATE=
  257. GIRDIR=
  258. GIRTYPELIBDIR=
  259. if test "$enable_introspection" = "yes"; then
  260. GOBJECT_INTROSPECTION_REQUIRED=0.6
  261. PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
  262. G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
  263. G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
  264. G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
  265. GIRDIR="$($PKG_CONFIG --variable=girdir gobject-introspection-1.0)"
  266. GIRTYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
  267. fi
  268. AC_SUBST([G_IR_SCANNER])
  269. AC_SUBST([G_IR_COMPILER])
  270. AC_SUBST([G_IR_GENERATE])
  271. AC_SUBST([GIRDIR])
  272. AC_SUBST([GIRTYPELIBDIR])
  273. AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
  274. dnl ================== portability checks ===========================================
  275. dnl for backtrace()
  276. AC_CHECK_HEADERS([execinfo.h])
  277. AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
  278. AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
  279. ],[],[#include <langinfo.h>])
  280. dnl ================== pdf checks ===================================================
  281. AC_ARG_ENABLE([pdf],
  282. [AS_HELP_STRING([--disable-pdf],
  283. [Disable the PDF support])],
  284. [enable_pdf=$enableval],
  285. [enable_pdf=yes])
  286. if test "x$enable_pdf" = "xyes"; then
  287. POPPLER_REQUIRED=0.22.0
  288. PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED,enable_pdf=yes,enable_pdf=no)
  289. if test "x$enable_pdf" = "xyes"; then
  290. PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
  291. if test x$enable_cairo_pdf = xyes; then
  292. AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
  293. fi
  294. PKG_CHECK_MODULES(CAIRO_PS, cairo-ps, enable_cairo_ps=yes, enable_cairo_ps=no)
  295. if test x$enable_cairo_ps = xyes; then
  296. AC_DEFINE([HAVE_CAIRO_PS], [1], [defined if cairo-ps is available])
  297. fi
  298. else
  299. AC_MSG_ERROR("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
  300. fi
  301. fi
  302. AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
  303. dnl ================== end of pdf checks ============================================
  304. dnl libspectre (used by ps and dvi backends)
  305. SPECTRE_REQUIRED=0.2.0
  306. PKG_CHECK_MODULES(SPECTRE, libspectre >= $SPECTRE_REQUIRED,have_spectre=yes,have_spectre=no)
  307. AM_CONDITIONAL(HAVE_SPECTRE, test x$have_spectre = xyes)
  308. if test "x$have_spectre" = "xyes"; then
  309. AC_DEFINE([HAVE_SPECTRE], [1], [Have libspectre])
  310. fi
  311. dnl ================== ps checks ====================================================
  312. AC_ARG_ENABLE(ps,
  313. [AS_HELP_STRING([--disable-ps],
  314. [Disable the PostScript backend])],
  315. [enable_ps=$enableval],
  316. [enable_ps=yes])
  317. if test "x$enable_ps" = "xyes"; then
  318. if test "x$have_spectre" = "xyes"; then
  319. AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
  320. else
  321. enable_ps="no"
  322. AC_MSG_WARN([PS support is disabled since libspectre (version >= $SPECTRE_REQUIRED) is needed])
  323. fi
  324. fi
  325. AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
  326. dnl ======================== End of ps checks ===================================
  327. dnl ================== tiff checks ===================================================
  328. AC_ARG_ENABLE(tiff,
  329. [AS_HELP_STRING([--disable-tiff],
  330. [Disable the support of multipage tiff])],
  331. [enable_tiff=$enableval],
  332. [enable_tiff=yes])
  333. if test "x$enable_tiff" = "xyes"; then
  334. AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
  335. if test "x$enable_tiff" = "xyes"; then
  336. AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
  337. AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
  338. fi
  339. if test "x$enable_tiff" = "xyes"; then
  340. AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
  341. else
  342. AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
  343. fi
  344. fi
  345. AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
  346. dnl ================== end of tiff checks ============================================
  347. dnl ================== djvu checks ===================================================
  348. AC_ARG_ENABLE(djvu,
  349. [AS_HELP_STRING([--disable-djvu],
  350. [Disable the support of djvu viewer])],
  351. [enable_djvu=$enableval],
  352. [enable_djvu=yes])
  353. if test "x$enable_djvu" = "xyes"; then
  354. DJVULIBRE_REQUIRED=3.5.17
  355. PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
  356. if test "x$enable_djvu" = "xyes"; then
  357. AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
  358. else
  359. AC_MSG_WARN([
  360. ** Djvu support is disabled since a recent version of the djvulibre
  361. ** library was not found. You need at least djvulibre-3.5.17 which
  362. ** can be found on http://djvulibre.djvuzone.org
  363. ])
  364. fi
  365. fi
  366. AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
  367. dnl ================== End of djvu checks ===================================================
  368. dnl ================== dvi checks ===================================================
  369. AC_ARG_ENABLE(dvi,
  370. [AS_HELP_STRING([--disable-dvi],
  371. [Disable the support of dvi viewer])],
  372. [enable_dvi=$enableval],
  373. [enable_dvi=yes])
  374. AC_ARG_ENABLE(t1lib,
  375. [AS_HELP_STRING([--enable-t1lib],
  376. [Compile with support of t1lib for type1 fonts in dvi])],
  377. [enable_type1_fonts=$enableval],
  378. [enable_type1_fonts=no])
  379. if test "x$enable_dvi" = "xyes"; then
  380. AC_C_CONST
  381. AC_C_INLINE
  382. AC_TYPE_SIZE_T
  383. AC_CHECK_SIZEOF(long, 4)
  384. AC_CHECK_SIZEOF(int, 4)
  385. AC_CHECK_SIZEOF(short, 2)
  386. AC_CHECK_SIZEOF(void *, 4)
  387. AC_CHECK_LIB([kpathsea], [kpse_init_prog], [enable_dvi=yes], [enable_dvi=no])
  388. if test "x$enable_dvi" = "xyes"; then
  389. AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
  390. else
  391. AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
  392. fi
  393. fi
  394. AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
  395. if test "x$enable_dvi" = "xyes"; then
  396. if test "x$enable_type1_fonts" = "xyes"; then
  397. AC_CHECK_LIB([t1],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no,[-lm])
  398. fi
  399. if test "x$enable_type1_fonts" = xyes; then
  400. AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
  401. fi
  402. else
  403. enable_type1_fonts=no
  404. fi
  405. AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
  406. dnl ================== End of dvi checks ===================================================
  407. dnl ================== pixbuf checks ===================================================
  408. AC_ARG_ENABLE(pixbuf,
  409. [AS_HELP_STRING([--enable-pixbuf],
  410. [Compile with support of pixbuf])],
  411. [enable_pixbuf=$enableval],
  412. [enable_pixbuf=no])
  413. if test "x$enable_pixbuf" = "xyes"; then
  414. AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.])
  415. fi
  416. AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes)
  417. dnl ================== End of pixbuf checks ===================================================
  418. dnl ================== comic book checks ===================================================
  419. AC_ARG_ENABLE(comics,
  420. [AS_HELP_STRING([--enable-comics],
  421. [Compile with support for comic book archives])],
  422. [enable_comics=$enableval],
  423. [enable_comics=yes])
  424. if test "x$enable_comics" = "xyes"; then
  425. AC_DEFINE([ENABLE_COMICS], [1], [Enable support for comics.])
  426. fi
  427. AM_CONDITIONAL(ENABLE_COMICS, test x$enable_comics = xyes)
  428. dnl ================== End of comic book checks ============================================
  429. dnl ================== XPS checks ===================================================
  430. AC_ARG_ENABLE(xps,
  431. [AS_HELP_STRING([--enable-xps],
  432. [Compile with support for XPS documents.])],
  433. [enable_xps=$enableval],
  434. [enable_xps=yes])
  435. if test "x$enable_xps" = "xyes"; then
  436. GXPS_REQUIRED=0.2.1
  437. PKG_CHECK_MODULES(GXPS, libgxps >= $GXPS_REQUIRED,enable_xps=yes,enable_xps=no)
  438. if test "x$enable_xps" = "xyes"; then
  439. AC_DEFINE([ENABLE_XPS], [1], [Enable support for XPS documents.])
  440. else
  441. enable_xps="no"
  442. AC_MSG_WARN(["XPS support is disabled since libgxps (version >= $GXPS_REQUIRED) is needed"])
  443. fi
  444. fi
  445. AM_CONDITIONAL(ENABLE_XPS, test x$enable_xps = xyes)
  446. dnl ================== End of XPS checks ===================================================
  447. dnl ================== EPUB checks ===================================================
  448. AC_ARG_ENABLE(epub,
  449. [AS_HELP_STRING([--enable-epub],
  450. [Compile with support for epub documents.])],
  451. [enable_epub=$enableval],
  452. [enable_epub=yes])
  453. have_webkit="no"
  454. if test "x$enable_epub" = "xyes"; then
  455. PKG_CHECK_MODULES(EPUB, webkit2gtk-$WEBKIT_API_VERSION >= $WEBKIT_REQUIRED \
  456. libxml-2.0 >= $LIBXML_REQUIRED zlib,have_webkit=yes,have_webkit=no)
  457. if test "x$have_webkit" = "xno"; then
  458. AC_MSG_NOTICE([Webkit2 4.0 not found, trying 3.0])
  459. WEBKIT_API_VERSION=3.0
  460. PKG_CHECK_MODULES(EPUB, webkit2gtk-$WEBKIT_API_VERSION >= $WEBKIT_REQUIRED \
  461. libxml-2.0 >= $LIBXML_REQUIRED zlib,have_webkit=yes,have_webkit=no)
  462. fi
  463. if test "x$have_webkit" = "xyes"; then
  464. AC_DEFINE([ENABLE_EPUB], [1], [Enable support for ePub documents.])
  465. else
  466. AC_MSG_WARN(["ePub support is disabled."])
  467. fi
  468. fi
  469. AM_CONDITIONAL(ENABLE_EPUB, test x$have_webkit = xyes)
  470. dnl ================== End of EPUB checks ===================================================
  471. dnl =================== Mime types list ====================================================
  472. if test "x$enable_pdf" = "xyes" ; then
  473. XREADER_MIME_TYPES="application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;"
  474. fi
  475. if test "x$enable_ps" = "xyes" ; then
  476. XREADER_MIME_TYPES="${XREADER_MIME_TYPES}application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;"
  477. fi
  478. if test "x$enable_dvi" = "xyes"; then
  479. XREADER_MIME_TYPES="${XREADER_MIME_TYPES}application/x-dvi;application/x-bzdvi;application/x-gzdvi;"
  480. fi
  481. if test "x$enable_djvu" = "xyes"; then
  482. XREADER_MIME_TYPES="${XREADER_MIME_TYPES}image/vnd.djvu;image/vnd.djvu+multipage;"
  483. fi
  484. if test "x$enable_tiff" = "xyes"; then
  485. XREADER_MIME_TYPES="${XREADER_MIME_TYPES}image/tiff;"
  486. fi
  487. if test "x$enable_comics" = "xyes"; then
  488. XREADER_MIME_TYPES="${XREADER_MIME_TYPES}application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/vnd.comicbook+zip;"
  489. fi
  490. if test "x$enable_pixbuf" = "xyes"; then
  491. XREADER_MIME_TYPES="${XREADER_MIME_TYPES}image/*;"
  492. fi
  493. if test "x$enable_xps" = "xyes"; then
  494. XREADER_MIME_TYPES="${XREADER_MIME_TYPES}application/oxps;application/vnd.ms-xpsdocument;"
  495. fi
  496. if test "x$have_webkit" = "xyes"; then
  497. XREADER_MIME_TYPES="${XREADER_MIME_TYPES}application/epub+zip;"
  498. fi
  499. AC_SUBST(XREADER_MIME_TYPES)
  500. AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
  501. # *****************
  502. # Help files
  503. # *****************
  504. YELP_HELP_INIT
  505. # *****************
  506. # API documentation
  507. # *****************
  508. GTK_DOC_CHECK([1.13], [--flavour no-tmpl])
  509. AC_SUBST([GLIB_PREFIX], [$($PKG_CONFIG --variable=prefix glib-2.0)])
  510. AC_SUBST([GTK_PREFIX], [$($PKG_CONFIG --variable=prefix gtk+-3.0)])
  511. # ******************
  512. # Backends directory
  513. # ******************
  514. AC_SUBST([backenddir],"\$(libdir)/xreader/ev_binary_version/backends")
  515. AC_SUBST([backend_binary_version], "ev_binary_version")
  516. # **********
  517. # Versioning
  518. # **********
  519. AC_SUBST([EV_MAJOR_VERSION], [ev_major_version])
  520. AC_SUBST([EV_MINOR_VERSION], [ev_minor_version])
  521. AC_SUBST([EV_MICRO_VERSION], [ev_micro_version])
  522. AC_SUBST([EV_API_VERSION], [ev_api_version])
  523. AC_SUBST([EV_API_VERSION_U], [AS_TR_SH([ev_api_version])])
  524. AC_SUBST([EV_BINARY_VERSION], [ev_binary_version])
  525. AC_SUBST([EV_DOCUMENT_LT_VERSION_INFO],[ev_document_lt_version_info])
  526. AC_SUBST([EV_DOCUMENT_LT_CURRENT_MINUS_AGE],[ev_document_lt_current_minus_age])
  527. AC_SUBST([EV_VIEW_LT_VERSION_INFO], [ev_view_lt_version_info])
  528. AC_SUBST([EV_VIEW_LT_CURRENT_MINUS_AGE], [ev_view_lt_current_minus_age])
  529. # *****************************************************************************
  530. # *****************************************************************************
  531. AC_CONFIG_FILES([
  532. backend/Makefile
  533. backend/comics/Makefile
  534. backend/djvu/Makefile
  535. backend/dvi/Makefile
  536. backend/dvi/mdvi-lib/Makefile
  537. backend/epub/Makefile
  538. backend/epub/minizip/Makefile
  539. backend/pdf/Makefile
  540. backend/pixbuf/Makefile
  541. backend/ps/Makefile
  542. backend/tiff/Makefile
  543. backend/xps/Makefile
  544. cut-n-paste/Makefile
  545. cut-n-paste/smclient/Makefile
  546. cut-n-paste/zoom-control/Makefile
  547. cut-n-paste/totem-screensaver/Makefile
  548. cut-n-paste/synctex/Makefile
  549. data/xreader.desktop.in
  550. data/Makefile
  551. data/icons/Makefile
  552. data/icons/16x16/Makefile
  553. data/icons/16x16/apps/Makefile
  554. data/icons/16x16/actions/Makefile
  555. data/icons/16x16/mimetypes/Makefile
  556. data/icons/22x22/Makefile
  557. data/icons/22x22/apps/Makefile
  558. data/icons/22x22/actions/Makefile
  559. data/icons/22x22/mimetypes/Makefile
  560. data/icons/24x24/Makefile
  561. data/icons/24x24/apps/Makefile
  562. data/icons/24x24/actions/Makefile
  563. data/icons/24x24/mimetypes/Makefile
  564. data/icons/32x32/Makefile
  565. data/icons/32x32/actions/Makefile
  566. data/icons/32x32/mimetypes/Makefile
  567. data/icons/48x48/Makefile
  568. data/icons/48x48/apps/Makefile
  569. data/icons/48x48/actions/Makefile
  570. data/icons/scalable/Makefile
  571. data/icons/scalable/apps/Makefile
  572. data/icons/scalable/actions/Makefile
  573. data/icons/scalable/mimetypes/Makefile
  574. help/Makefile
  575. help/reference/Makefile
  576. help/reference/libdocument/Makefile
  577. help/reference/libdocument/version.xml
  578. help/reference/libview/Makefile
  579. help/reference/libview/version.xml
  580. help/reference/shell/Makefile
  581. help/reference/shell/version.xml
  582. libdocument/Makefile
  583. libdocument/ev-version.h
  584. libmisc/Makefile
  585. libview/Makefile
  586. Makefile
  587. po/Makefile.in
  588. previewer/Makefile
  589. properties-caja/libxreader-properties-page.caja-extension.in
  590. properties-caja/Makefile
  591. properties-nemo/libxreader-properties-page.nemo-extension.in
  592. properties-nemo/Makefile
  593. shell/Makefile
  594. test/Makefile
  595. thumbnailer/Makefile
  596. ])
  597. AC_CONFIG_FILES(xreader-document-[]ev_api_version[].pc:xreader-document.pc.in)
  598. AC_CONFIG_FILES(xreader-view-[]ev_api_version[].pc:xreader-view.pc.in)
  599. AC_OUTPUT
  600. echo "
  601. Configure summary:
  602. GTK+ Unix Print.....: $with_gtk_unix_print
  603. Keyring Support.....: $with_keyring
  604. DBUS Support........: $enable_dbus
  605. Caja Plugin.........: $enable_caja
  606. Nemo Plugin.........: $enable_nemo
  607. Thumbnailer.........: $enable_thumbnailer
  608. Previewer...........: $enable_previewer
  609. Gtk-Doc Support.....: $enable_gtk_doc
  610. Debug mode..........: $enable_debug
  611. GObj. Introspection.: $enable_introspection
  612. Tests...............: $enable_tests
  613. PDF Backend.........: $enable_pdf
  614. PostScript Backend..: $enable_ps
  615. TIFF Backend........: $enable_tiff
  616. DJVU Backend........: $enable_djvu
  617. DVI Backend.........: $enable_dvi
  618. Pixbuf Backend......: $enable_pixbuf
  619. Comics Backend......: $enable_comics
  620. XPS Backend.........: $enable_xps
  621. ePub Backend........: $have_webkit
  622. "