1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([Evince],[0.8.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=evince],[evince])
5 AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip])
7 AM_CONFIG_HEADER(config.h)
18 IT_PROG_INTLTOOL([0.35.0])
19 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
20 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
24 GNOME_MAINTAINER_MODE_DEFINES
25 GNOME_COMPILE_WARNINGS
31 GETTEXT_PACKAGE=evince
32 AC_SUBST(GETTEXT_PACKAGE)
33 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
36 dnl Check dependencies
38 # LIB_CFLAGS for helpers and generic widgets. (lib, cut-and-paste)
39 # BACKEND_CFLAGS for backend implementations.
40 # FRONTEND_CFLAGS for frontend implementations. (properties, thumbnailer)
42 # SHELL_CFLAGS for shell implementation.
45 DBUS_GLIB_REQUIRED=0.70
47 KEYRING_REQUIRED=0.4.0
49 LIBGNOMEUI_REQUIRED=2.14.0
50 LIBGNOME_REQUIRED=2.14.0
51 LIBGNOMEPRINTUI_REQUIRED=2.6.0
52 GNOME_ICON_THEME_REQUIRED=2.17.1
55 GTK_PRINT_REQUIRED=2.10.0
57 PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED)
58 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED gnome-vfs-2.0)
59 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 gnome-vfs-2.0)
60 PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0 gnome-keyring-1 >= $KEYRING_REQUIRED)
63 AC_HELP_STRING([--without-libgnome],[disable the use of libgnome]),
65 yes) WITH_GNOME=yes ;;
67 *) AC_MSG_ERROR(bad value ${withval} for --with-libgnome) ;;
69 [WITH_GNOME=yes]) dnl Default value
70 AM_CONDITIONAL(WITH_GNOME, test x$WITH_GNOME = "xyes")
72 if test x$WITH_GNOME = "xyes"; then
73 PKG_CHECK_MODULES(GNOME, libgnome-2.0 >= $LIBGNOME_REQUIRED)
74 PKG_CHECK_MODULES(GNOMEUI, libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
75 AC_DEFINE([WITH_GNOME],[1],[Define if GNOME support is enabled])
78 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
79 AC_SUBST(GLIB_GENMARSHAL)
81 dnl ========= Print support
83 [AC_HELP_STRING([--with-print=no/gtk/gnome/auto], [Compile with print support [default=auto]])],
87 PKG_CHECK_MODULES(GNOME_PRINT,
88 libgnomeprintui-2.2 >= $LIBGNOMEPRINTUI_REQUIRED,
89 enable_gnome_print=yes, enable_gnome_print=no)
90 PKG_CHECK_MODULES(GTK_PRINT,
91 gtk+-unix-print-2.0 >= $GTK_PRINT_REQUIRED,
92 enable_gtk_print=yes, enable_gtk_print=no)
94 if test x$PRINT = xgnome -a x$enable_gnome_print = xyes; then
97 if test x$PRINT = xgtk -a x$enable_gtk_print = xyes; then
100 if test x$PRINT = xauto; then
101 if test x$enable_gtk_print = xyes; then
104 if test x$enable_gnome_print = xyes; then
112 if test x$enable_print = xgnome; then
113 AC_SUBST(GNOME_PRINT_CFLAGS)
114 AC_SUBST(GNOME_PRINT_LIBS)
115 AC_DEFINE([WITH_GNOME_PRINT],[1],[Enable GNOME Print Support.])
116 AC_DEFINE([WITH_PRINT],[1],[Enable Print Support.])
119 if test x$enable_print = xgtk; then
120 AC_SUBST(GTK_PRINT_CFLAGS)
121 AC_SUBST(GTK_PRINT_LIBS)
122 AC_DEFINE([WITH_GTK_PRINT],[1],[Enable GTK Print Support.])
123 AC_DEFINE([WITH_PRINT],[1],[Enable Print Support.])
126 AM_CONDITIONAL(WITH_GNOME_PRINT, test x$enable_print = xgnome)
127 AM_CONDITIONAL(WITH_GTK_PRINT, test x$enable_print = xgtk)
130 dnl ========= Check for DBUS
131 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
132 [enable_dbus=yes],[enable_dbus=no])
133 AC_SUBST([DBUS_CFLAGS])
134 AC_SUBST([DBUS_LIBS])
136 if test "x$enable_dbus" = "xno"; then
137 AC_MSG_WARN([DBUS support is disabled since dbus $DBUS_GLIB_REQUIRED or higher was not found])
140 if test "x$enable_dbus" = "xyes" ; then
141 AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
143 if test x$DBUS_BINDING_TOOL = "xno" ; then
144 AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
147 AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
150 LIB_CFLAGS="$LIB_CFLAGS $GNOME_CFLAGS"
151 LIB_LIBS="$LIB_LIBS $GNOME_LIBS"
155 BACKEND_CFLAGS="$BACKEND_CFLAGS $GNOME_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
156 BACKEND_LIBS="$BACKEND_LIBS $GNOME_LIBS"
157 AC_SUBST(BACKEND_CFLAGS)
158 AC_SUBST(BACKEND_LIBS)
160 SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $GNOMEUI_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
161 SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $GNOMEUI_LIBS -lz"
162 AC_SUBST(SHELL_CFLAGS)
165 FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS $GNOME_CFLAGS"
166 FRONTEND_LIBS="$FRONTEND_CORE_LIBS $GNOME_LIBS -lz"
167 AC_SUBST(FRONTEND_CFLAGS)
168 AC_SUBST(FRONTEND_LIBS)
170 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
171 AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
173 dnl Check for Nautilus property page build
174 AC_ARG_ENABLE(nautilus,
175 AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
176 [case "${enableval}" in
177 yes) ENABLE_NAUTILUS=yes ;;
178 no) ENABLE_NAUTILUS=no ;;
179 *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
181 [ENABLE_NAUTILUS=yes]) dnl Default value
183 if test x$ENABLE_NAUTILUS = "xyes" ; then
184 PKG_CHECK_MODULES(NAUTILUS, gtk+-x11-2.0 $MM gthread-2.0 libnautilus-extension,
185 [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
188 AC_SUBST(NAUTILUS_CFLAGS)
189 AC_SUBST(NAUTILUS_LIBS)
190 if test x$HAVE_NAUTILUS = "xyes"; then
191 AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
193 AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
196 dnl Check for thumbnailer build
197 AC_ARG_ENABLE(thumbnailer,
198 AC_HELP_STRING([--disable-thumbnailer],[disable the GNOME thumbnailer]),
199 [case "${enableval}" in
200 yes) ENABLE_THUMBNAILER=yes ;;
201 no) ENABLE_THUMBNAILER=no ;;
202 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thumbnailer) ;;
204 [ENABLE_THUMBNAILER=yes]) dnl Default value
205 AM_CONDITIONAL(ENABLE_THUMBNAILER, test x$ENABLE_THUMBNAILER = "xyes")
208 dnl Check for GtkRecent
209 PKG_CHECK_MODULES(GTK_RECENT, gtk+-2.0 >= 2.10.0,
210 [HAVE_GTK_RECENT=yes], [HAVE_GTK_RECENT=no])
211 if test x$HAVE_GTK_RECENT = xyes; then
212 AC_DEFINE([HAVE_GTK_RECENT], [1], [defined if GtkRecent is available])
214 AM_CONDITIONAL(HAVE_GTK_RECENT, test x$HAVE_GTK_RECENT = "xyes")
216 dnl GConf configuration
219 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
220 if test "x$GCONFTOOL" = "xno"; then
221 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
224 dnl ================== portability checks ===========================================
227 AC_CHECK_HEADERS([execinfo.h])
229 AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
230 AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
231 ],[],[#include <langinfo.h>])
233 dnl ================== pdf checks ===================================================
235 [AC_HELP_STRING([--enable-pdf], [Compile with pdf support])],enable_pdf="$enableval",enable_pdf=yes)
237 if test "x$enable_pdf" = "xyes"; then
238 POPPLER_REQUIRED=0.5.4
239 PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED,enable_pdf=yes,enable_pdf=no)
241 if test "x$enable_pdf" = "xyes"; then
242 AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.])
243 FRONTEND_LIBS="$FRONTEND_LIBS $POPPLER_LIBS"
244 SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS"
245 SHELL_CFLAGS="$SHELL_CFLAGS $POPPLER_CFLAGS"
247 evince_save_LIBS=$LIBS
248 LIBS="$LIBS $FRONTEND_LIBS"
249 AC_CHECK_FUNCS(poppler_page_render)
250 AC_CHECK_FUNCS(poppler_page_get_duration)
251 AC_CHECK_FUNCS(poppler_page_get_image_mapping)
252 LIBS=$evince_save_LIBS
254 PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
255 if test x$enable_cairo_pdf == xyes; then
256 AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
259 AC_MSG_WARN("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
263 AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
264 dnl ================== end of pdf checks ============================================
266 dnl ================== ggv checks ===================================================
268 [AC_HELP_STRING([--disable-ps], [Compile without PostScript backend])],enable_ps=$enableval,enable_ps="yes")
270 if test x$enable_ps = xyes; then
271 AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
274 AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
276 if test x$enable_ps = xyes; then
278 dnl check for GS version
279 AC_MSG_CHECKING(for Ghostscript version...)
280 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
281 AC_MSG_RESULT(found $GS_VERSION)
282 if test "$GS_VERSION" -lt "7"; then
283 AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
286 AC_ARG_WITH(gs-aa-params,
287 [AC_HELP_STRING([--with-gs-aa-params], [Define antialiasing params for ghostscript])],AA_PARAMS=$withval,
288 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dDOINTERPOLATE"
290 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
291 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
294 dnl ======================== End of ggv checks =================================
296 dnl ================== tiff checks ===================================================
298 [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
300 if test "x$enable_tiff" = "xyes"; then
301 AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
302 if test "x$enable_tiff" = "xyes"; then
303 AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
304 AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
306 if test "x$enable_tiff" = "xyes"; then
307 AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
308 FRONTEND_LIBS="$FRONTEND_LIBS -ltiff"
309 SHELL_LIBS="$SHELL_LIBS -ltiff"
311 AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
315 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
316 dnl ================== end of tiff checks ============================================
318 dnl ================== djvu checks ===================================================
321 [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=no)
323 if test "x$enable_djvu" = "xyes"; then
325 DJVULIBRE_REQUIRED=3.5.17
327 PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
329 if test "x$enable_djvu" = "xyes"; then
330 AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
333 ** Djvu support is disabled since a recent version of the djvulibre
334 ** library was not found. You need at least djvulibre-3.5.17 which
335 ** can be found on http://djvulibre.djvuzone.org
340 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
342 dnl ================== End of djvu checks ===================================================
344 dnl ================== dvi checks ===================================================
347 [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=no)
350 [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
352 if test "x$enable_dvi" = "xyes"; then
356 AC_CHECK_SIZEOF(long, 4)
357 AC_CHECK_SIZEOF(int, 4)
358 AC_CHECK_SIZEOF(short, 2)
359 AC_CHECK_SIZEOF(void *, 4)
360 AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
362 if test "x$enable_dvi" = "xyes"; then
363 AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
365 AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
368 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
370 if test "x$enable_dvi" = "xyes"; then
371 if test "x$enable_type1_fonts" = "xyes"; then
372 AC_CHECK_LIB([t1],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no,[-lm])
375 if test "x$enable_type1_fonts" = xyes; then
376 AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
379 enable_type1_fonts=no
381 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
383 dnl ================== End of dvi checks ===================================================
385 dnl ================== pixbuf checks ===================================================
387 AC_ARG_ENABLE(pixbuf,
388 [AC_HELP_STRING([--enable-pixbuf], [Compile with support of pixbuf])],enable_pixbuf="$enableval",enable_pixbuf=no)
389 if test "x$enable_pixbuf" = "xyes"; then
390 AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.])
392 AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes)
394 dnl ================== End of pixbuf checks ===================================================
396 dnl ================== comic book checks ===================================================
398 AC_ARG_ENABLE(comics,
399 [AC_HELP_STRING([--enable-comics], [Compile with support for comic book archives])],enable_comics="$enableval",enable_comics=no)
400 if test "x$enable_comics" = "xyes"; then
401 AC_DEFINE([ENABLE_COMICS], [1], [Enable support for comics.])
403 AM_CONDITIONAL(ENABLE_COMICS, test x$enable_comics = xyes)
405 dnl ================== End of comic book checks ============================================
407 dnl ================== impress book checks ===================================================
409 AC_ARG_ENABLE(impress,
410 [AC_HELP_STRING([--enable-impress], [Compile with support for impress presentations])],enable_impress="$enableval",enable_impress=no)
411 if test "x$enable_impress" = "xyes"; then
412 AC_DEFINE([ENABLE_IMPRESS], [1], [Enable support for impress.])
414 AM_CONDITIONAL(ENABLE_IMPRESS, test x$enable_impress = xyes)
416 dnl ================== End of impress book checks ============================================
418 dnl =================== Mime types list ====================================================
420 if test "x$enable_pdf" = "xyes" ; then
421 EVINCE_MIME_TYPES="application/pdf;application/x-bzpdf;application/x-gzpdf"
423 if test "x$enable_ps" = "xyes" ; then
424 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps"
426 if test "x$enable_dvi" = "xyes"; then
427 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-dvi"
429 if test "x$enable_djvu" = "xyes"; then
430 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/vnd.djvu"
432 if test "x$enable_tiff" = "xyes"; then
433 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/tiff"
435 if test "x$enable_comics" = "xyes"; then
436 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-cbr;application/x-cbz"
438 if test "x$enable_pixbuf" = "xyes"; then
439 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/*"
441 if test "x$enable_impress" = "xyes"; then
442 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/vnd.sun.xml.impress;application/vnd.oasis.opendocument.presentation"
444 AC_SUBST(EVINCE_MIME_TYPES)
446 evince_save_LIBS=$LIBS
447 LIBS="$LIBS $FRONTEND_LIBS"
448 AC_CHECK_FUNCS(gtk_paper_size_get_paper_sizes)
449 LIBS=$evince_save_LIBS
453 backend/comics/Makefile
454 backend/djvu/Makefile
456 backend/dvi/mdvi-lib/Makefile
457 backend/impress/Makefile
459 backend/pixbuf/Makefile
461 backend/tiff/Makefile
463 cut-n-paste/recent-files/Makefile
464 cut-n-paste/toolbar-editor/Makefile
465 cut-n-paste/zoom-control/Makefile
466 cut-n-paste/totem-screensaver/Makefile
467 data/evince.desktop.in
470 data/icons/16x16/Makefile
471 data/icons/16x16/apps/Makefile
472 data/icons/16x16/actions/Makefile
473 data/icons/22x22/Makefile
474 data/icons/22x22/apps/Makefile
475 data/icons/22x22/actions/Makefile
476 data/icons/24x24/Makefile
477 data/icons/24x24/apps/Makefile
478 data/icons/24x24/actions/Makefile
479 data/icons/48x48/Makefile
480 data/icons/48x48/apps/Makefile
481 data/icons/scalable/Makefile
482 data/icons/scalable/apps/Makefile
484 help/reference/Makefile
485 help/reference/version.xml
499 GNOME Support......: $WITH_GNOME
500 Print Support......: $enable_print
501 DBUS Support.......: $enable_dbus
502 Nautilus Plugin....: $HAVE_NAUTILUS
503 Thumbnailer........: $ENABLE_THUMBNAILER
504 Gtk-Doc Support....: $enable_gtk_doc
506 PDF Backend........: $enable_pdf
507 PostScript Backend.: $enable_ps
508 TIFF Backend.......: $enable_tiff
509 DJVU Backend.......: $enable_djvu
510 DVI Backend........: $enable_dvi
511 Pixbuf Backend.....: $enable_pixbuf
512 Comics Backend.....: $enable_comics
513 Impress Backend....: $enable_impress