]> www.fi.muni.cz Git - evince.git/blob - configure.ac
[windows] Make evince relocatable on windows - GUI
[evince.git] / configure.ac
1 # *****************************************************************************
2 # Versioning
3 # *****************************************************************************
4
5 m4_define([ev_major_version],[2])
6 m4_define([ev_minor_version],[27])
7 m4_define([ev_micro_version],[1])
8 m4_define([ev_extra_version],[])
9 m4_define([ev_version],[ev_major_version.ev_minor_version.ev_micro_version()ev_extra_version])
10
11 # The evince API version
12 m4_define([ev_api_version], [2.25])
13
14 # Libtool versioning. The backend and view libraries have separate versions.
15 # Before making a release, the libtool version should be modified.
16 # The string is of the form C:R:A.
17 # - If interfaces have been changed or added, but binary compatibility has
18 #   been preserved, change to C+1:0:A+1
19 # - If binary compatibility has been broken (eg removed or changed interfaces)
20 #   change to C+1:0:0
21 # - If the interface is the same as the previous version, change to C:R+1:A
22
23 # Libtool version of the backend library
24 m4_define([ev_document_lt_current],[1])
25 m4_define([ev_document_lt_revision],[0])
26 m4_define([ev_document_lt_age],[0])
27 m4_define([ev_document_lt_version_info],[ev_document_lt_current:ev_document_lt_revision:ev_document_lt_age])
28 m4_define([ev_document_lt_current_minus_age],[m4_eval(ev_document_lt_current - ev_document_lt_age)])
29
30 # Libtool version of the view library
31 m4_define([ev_view_lt_current],[1])
32 m4_define([ev_view_lt_revision],[0])
33 m4_define([ev_view_lt_age],[0])
34 m4_define([ev_view_lt_version_info],[ev_view_lt_current:ev_view_lt_revision:ev_view_lt_age])
35 m4_define([ev_view_lt_current_minus_age],[m4_eval(ev_view_lt_current - ev_view_lt_age)])
36
37 # Binary version for the document backends
38 m4_define([ev_binary_version],[ev_document_lt_current])
39
40 # *****************************************************************************
41
42 AC_PREREQ([2.57])
43 AC_INIT([Evince],[ev_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=evince],[evince])
44 AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip])
45
46 AM_CONFIG_HEADER(config.h)
47 AC_CONFIG_MACRO_DIR(m4)
48
49 AM_MAINTAINER_MODE
50
51 AM_PROG_LIBTOOL
52
53 AC_ISC_POSIX
54 AC_PROG_CC
55 AM_PROG_CC_STDC
56 AM_PROG_CC_C_O
57 AC_PROG_CXX
58 AC_STDC_HEADERS
59 IT_PROG_INTLTOOL([0.35.0])
60 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
61 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
62
63 GNOME_COMMON_INIT
64 GNOME_DOC_INIT
65 GNOME_MAINTAINER_MODE_DEFINES
66 GNOME_COMPILE_WARNINGS
67 GNOME_CXX_WARNINGS
68
69 GTK_DOC_CHECK(1.0)
70
71 GETTEXT_PACKAGE=evince
72 AC_SUBST(GETTEXT_PACKAGE)
73 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
74 AM_GLIB_GNU_GETTEXT
75
76 dnl check for win32 platform
77 AC_MSG_CHECKING([for Win32 platform])
78 case "$host" in
79   *-*-mingw*|*-*-cygwin*)
80     platform_win32=yes
81     AC_CHECK_TOOL(WINDRES, windres)
82     ;;
83   *)
84     platform_win32=no
85     ;;
86 esac
87 AC_MSG_RESULT([$platform_win32])
88 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
89
90 AC_MSG_CHECKING([for native Win32])
91 case "$host" in
92   *-*-mingw*)
93     os_win32=yes
94     ;;
95   *)
96     os_win32=no
97     ;;
98 esac
99 AC_MSG_RESULT([$os_win32])
100 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
101
102 dnl Check dependencies
103
104 # LIB_CFLAGS       for helpers and generic widgets. (libdocument, cut-and-paste)
105 # BACKEND_CFLAGS   for backend implementations.
106 # FRONTEND_CFLAGS  for frontend implementations. (properties, thumbnailer)
107 # FRONTEND_LIBS
108 # SHELL_CFLAGS     for shell implementation.
109 # SHELL_LIBS
110
111 DBUS_GLIB_REQUIRED=0.70
112 GTK_REQUIRED=2.14.0
113 GLIB_REQUIRED=2.18.0
114 KEYRING_REQUIRED=2.22.0
115 AC_SUBST([GLIB_REQUIRED])
116 AC_SUBST([GTK_REQUIRED])
117
118 GNOME_ICON_THEME_REQUIRED=2.17.1
119 LIBXML_REQUIRED=2.5.0
120
121 PKG_CHECK_MODULES(LIBDOCUMENT, gtk+-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
122 PKG_CHECK_MODULES(LIBVIEW, gtk+-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
123 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED)
124 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
125 PKG_CHECK_MODULES(PREVIEWER, gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
126 PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gthread-2.0)
127
128 if test "$os_win32" = no; then
129         PKG_CHECK_MODULES(SMCLIENT, gtk+-2.0 gthread-2.0 sm >= 1.0.0)
130 else
131         PKG_CHECK_MODULES(SMCLIENT, gtk+-2.0 gthread-2.0)
132 fi
133
134 AC_SUBST(SMCLIENT_CFLAGS)
135 AC_SUBST(SMCLIENT_LIBS)
136
137 BACKEND_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -export-symbols \$(top_srcdir)/backend/backend.symbols"
138 AC_SUBST(BACKEND_LIBTOOL_FLAGS)
139
140 dnl ===== Check special functions
141 evince_save_LIBS=$LIBS
142 LIBS="$LIBS $BACKEND_LIBS"
143 AC_CHECK_FUNCS(cairo_format_stride_for_width)
144 LIBS=$evince_save_LIBS
145
146 dnl ========= Check for Keyring
147 AC_ARG_WITH(keyring,
148         AC_HELP_STRING([--without-keyring],[disable the use of gnome-keyring]),
149         [case "${withval}" in
150         yes) WITH_KEYRING=yes ;;
151         no) WITH_KEYRING=no ;;
152         *) AC_MSG_ERROR(bad value ${withval} for --with-keyring) ;;
153         esac],
154         [WITH_KEYRING=check]) dnl Default value
155
156 if test x$WITH_KEYRING != "xno"; then
157         PKG_CHECK_MODULES(KEYRING, gnome-keyring-1 >= $KEYRING_REQUIRED,
158                 WITH_KEYRING=yes,
159                 if test "x$WITH_KEYRING" = "xcheck"; then
160                         WITH_KEYRING=no
161                         AC_MSG_WARN(The use of gnome-keyring is disabled since required library gnome-keyring-1 >= $KEYRING_REQUIRED was not found.)
162                 else
163                         AC_MSG_FAILURE(Gnome-keyring test failed: $KEYRING_PKG_ERRORS)
164                 fi
165         )
166 fi
167 if test x$WITH_KEYRING = "xyes"; then
168         AC_DEFINE([WITH_KEYRING],[1],[Define if KEYRING support is enabled])
169 fi
170 AM_CONDITIONAL(WITH_KEYRING, test x$WITH_KEYRING = "xyes")
171
172 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
173 AC_SUBST(GLIB_GENMARSHAL)
174
175 dnl ========= Check for DBUS
176 AC_ARG_ENABLE(dbus,
177         [AC_HELP_STRING([--enable-dbus], [Compile with support for dbus])],
178         enable_dbus="$enableval",enable_dbus=yes)
179 if test "x$enable_dbus" != "xno"; then
180         PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
181         [enable_dbus=yes],[enable_dbus=no])
182
183         if test "x$enable_dbus" = "xno"; then
184            AC_MSG_WARN([DBUS support is disabled since dbus $DBUS_GLIB_REQUIRED or higher was not found])
185         fi         
186
187         if test "x$enable_dbus" = "xyes" ; then
188                 AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
189
190                 if test x$DBUS_BINDING_TOOL = "xno" ; then
191                         AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
192                 fi                                            
193
194                 AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
195         fi
196 fi
197
198 AC_SUBST([DBUS_CFLAGS])
199 AC_SUBST([DBUS_LIBS])
200
201 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
202 AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
203
204 dnl ========= Check for GConf
205
206 AC_MSG_CHECKING([whether GConf support is requested])
207 AC_ARG_WITH([gconf],
208   [AS_HELP_STRING([--without-gconf],[disable the use of gconf])],
209   [],[with_gconf=check])
210 AC_MSG_RESULT([$with_gconf])
211
212 if test "x$with_gconf" != "xno"; then
213         PKG_CHECK_MODULES([GCONF],[gconf-2.0],
214                 with_gconf=yes,
215                 if test "x$with_gconf" = "xcheck"; then
216                         with_gconf=no
217                         AC_MSG_WARN(The use of GConf is disabled since required library gconf-2.0 was not found.)
218                 else
219                         AC_MSG_FAILURE(GConf test failed: $GCONF_PKG_ERRORS)
220                 fi
221         )
222 fi
223 if test "x$with_gconf" = "xyes"; then
224         AC_DEFINE([WITH_GCONF],[1],[Define if GConf support is enabled])
225 fi
226 AM_CONDITIONAL([WITH_GCONF],[test "$with_gconf" = "yes"])
227
228 AM_GCONF_SOURCE_2
229
230 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [false])
231 if test "$with_gconf" = "yes" -a "$GCONFTOOL" = "false"; then
232   AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
233 fi
234
235 dnl Debug mode
236
237 AC_ARG_ENABLE([debug],
238         AC_HELP_STRING([--enable-debug],
239                         [Turn on evince debug mode]),,
240                 [enable_debug=no])
241                 
242 if test "x$enable_debug" = "xyes"; then
243    DEBUG_FLAGS="-DEV_ENABLE_DEBUG"
244 fi
245
246
247 LIBDOCUMENT_CFLAGS="$LIBDOCUMENT_CFLAGS $DEBUG_FLAGS"
248 LIBDOCUMENT_LIBS="$LIBDOCUMENT_LIBS"
249 AC_SUBST(LIBDOCUMENT_CFLAGS)
250 AC_SUBST(LIBDOCUMENT_LIBS)
251
252 LIBVIEW_CFLAGS="$LIBVIEW_CFLAGS $DEBUG_FLAGS"
253 LIBVIEW_LIBS="$LIBVIEW_LIBS"
254 AC_SUBST(LIBVIEW_CFLAGS)
255 AC_SUBST(LIBVIEW_LIBS)
256
257 BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
258 AC_SUBST(BACKEND_CFLAGS)
259 AC_SUBST(BACKEND_LIBS)
260
261 SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $KEYRING_CFLAGS $GCONF_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
262 SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $KEYRING_LIBS $GCONF_LIBS -lz"
263 AC_SUBST(SHELL_CFLAGS)
264 AC_SUBST(SHELL_LIBS)
265
266 FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS $DEBUG_FLAGS"
267 FRONTEND_LIBS="$FRONTEND_CORE_LIBS -lz"
268 AC_SUBST(FRONTEND_CFLAGS)
269 AC_SUBST(FRONTEND_LIBS)
270
271 dnl Check for Nautilus property page build
272 AC_ARG_ENABLE(nautilus,
273         AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
274         [case "${enableval}" in
275         yes) ENABLE_NAUTILUS=yes ;;
276         no) ENABLE_NAUTILUS=no ;;
277         *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
278         esac],
279         [ENABLE_NAUTILUS=yes]) dnl Default value
280
281 if test x$ENABLE_NAUTILUS = "xyes" ; then
282         PKG_CHECK_MODULES(NAUTILUS, gtk+-x11-2.0 $MM gthread-2.0 libnautilus-extension,
283                         [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
284         NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
285         AC_SUBST(NAUTILUS_EXTENSION_DIR)
286 fi
287
288 AC_SUBST(NAUTILUS_CFLAGS)
289 AC_SUBST(NAUTILUS_LIBS)
290 if test x$HAVE_NAUTILUS = "xyes"; then
291         AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
292 fi
293 AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
294
295
296 dnl Check for thumbnailer build
297 AC_ARG_ENABLE(thumbnailer,
298         AC_HELP_STRING([--disable-thumbnailer],[disable the GNOME thumbnailer]),
299         [case "${enableval}" in
300         yes) ENABLE_THUMBNAILER=yes ;;
301         no) ENABLE_THUMBNAILER=no ;;
302         *) AC_MSG_ERROR(bad value ${enableval} for --enable-thumbnailer) ;;
303         esac],
304         [ENABLE_THUMBNAILER=yes]) dnl Default value
305 AM_CONDITIONAL(ENABLE_THUMBNAILER, test x$ENABLE_THUMBNAILER = "xyes")
306
307 dnl Check for previewer build
308 AC_ARG_ENABLE(previewer,
309         AC_HELP_STRING([--disable-previewer],[disable the GNOME Document Previewer]),
310         [case "${enableval}" in
311         yes) ENABLE_PREVIEWER=yes ;;
312         no) ENABLE_PREVIEWER=no ;;
313         *) AC_MSG_ERROR(bad value ${enableval} for --enable-previewer) ;;
314         esac],
315         [ENABLE_PREVIEWER=yes]) dnl Default value
316 if test x$ENABLE_PREVIEWER = "xyes" ; then
317    PKG_CHECK_MODULES(PREVIEWER, gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED,
318                      [ENABLE_PREVIEWER=yes],[ENABLE_PREVIEWER=no])
319    if test x$ENABLE_PREVIEWER = "xno" ; then
320       AC_MSG_WARN([Previewer support is disabled since gtk+-unix-print $GTK_REQUIRED or higher was not found])
321    fi
322 fi
323 AM_CONDITIONAL(ENABLE_PREVIEWER, test x$ENABLE_PREVIEWER = "xyes")
324 PREVIEWER_CFLAGS="$PREVIEWER_CFLAGS $DEBUG_FLAGS"
325 PREVIEWER_LIBS="$PREVIEWER_LIBS -lz"
326 AC_SUBST(PREVIEWER_CFLAGS)
327 AC_SUBST(PREVIEWER_LIBS)
328
329 # ***
330 # GIR
331 # ***
332
333 AC_MSG_CHECKING([whether GObject introspection is requested])
334 AC_ARG_ENABLE([introspection],
335         AS_HELP_STRING([--enable-introspection],[Enable GObject introspection]),
336         [],[enable_introspection=no])
337 AC_MSG_RESULT([$enable_introspection])
338
339 G_IR_SCANNER=
340 G_IR_COMPILER=
341 G_IR_GENERATE=
342 GIRDIR=
343 GIRTYPELIBDIR=
344
345 if test "$enable_introspection" = "yes"; then
346   GOBJECT_INTROSPECTION_REQUIRED=0.6
347   PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
348
349   G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
350   G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
351   G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
352   GIRDIR="$($PKG_CONFIG --variable=girdir gobject-introspection-1.0)"
353   GIRTYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
354 fi
355
356 AC_SUBST([G_IR_SCANNER])
357 AC_SUBST([G_IR_COMPILER])
358 AC_SUBST([G_IR_GENERATE])
359 AC_SUBST([GIRDIR])
360 AC_SUBST([GIRTYPELIBDIR])
361
362 AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
363
364 dnl ================== portability checks ===========================================
365
366 dnl for backtrace()
367 AC_CHECK_HEADERS([execinfo.h])
368
369 AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
370   AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
371   ],[],[#include <langinfo.h>])
372
373 dnl ================== pdf checks ===================================================
374 AC_ARG_ENABLE(pdf,
375               [AC_HELP_STRING([--enable-pdf], [Compile with pdf support])],enable_pdf="$enableval",enable_pdf=yes)
376
377 if test "x$enable_pdf" = "xyes"; then
378     POPPLER_REQUIRED=0.11.0
379     PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED,enable_pdf=yes,enable_pdf=no)
380
381     if test "x$enable_pdf" = "xyes"; then
382             AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.])
383             SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS"
384             SHELL_CFLAGS="$SHELL_CFLAGS $POPPLER_CFLAGS"
385
386             evince_save_LIBS=$LIBS
387             LIBS="$LIBS $POPPLER_LIBS"
388             AC_CHECK_FUNCS(poppler_page_render)
389             AC_CHECK_FUNCS(poppler_page_get_image)
390             LIBS=$evince_save_LIBS
391
392             PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
393             if test x$enable_cairo_pdf = xyes; then
394                     AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
395             fi
396
397             PKG_CHECK_MODULES(CAIRO_PS, cairo-ps, enable_cairo_ps=yes, enable_cairo_ps=no)
398             if test x$enable_cairo_ps = xyes; then
399                     AC_DEFINE([HAVE_CAIRO_PS], [1], [defined if cairo-ps is available])
400             fi
401     else
402             AC_MSG_WARN("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
403     fi 
404 fi
405
406 AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
407 dnl ================== end of pdf checks ============================================
408
409 dnl libspectre (used by ps and dvi backends)
410 SPECTRE_REQUIRED=0.2.0 
411 PKG_CHECK_MODULES(SPECTRE, libspectre >= $SPECTRE_REQUIRED,have_spectre=yes,have_spectre=no)
412 AM_CONDITIONAL(HAVE_SPECTRE, test x$have_spectre = xyes)
413 if test "x$have_spectre" = "xyes"; then
414    AC_DEFINE([HAVE_SPECTRE], [1], [Have libspectre])
415 fi
416
417 dnl ================== ps checks ====================================================
418 AC_ARG_ENABLE(ps,
419         [AC_HELP_STRING([--disable-ps], [Compile without PostScript backend])],enable_ps=$enableval,enable_ps="yes")
420
421 if test "x$enable_ps" = "xyes"; then
422    if test "x$have_spectre" = "xyes"; then
423       AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
424    else
425       enable_ps="no"
426       AC_MSG_WARN([PS support is disabled since libspectre (version >= $SPECTRE_REQUIRED) is needed])
427    fi
428 fi
429 AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
430 dnl ======================== End of ps checks ===================================
431
432 dnl ================== tiff checks ===================================================
433 AC_ARG_ENABLE(tiff,
434             [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
435
436 if test "x$enable_tiff" = "xyes"; then
437     AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
438     if test "x$enable_tiff" = "xyes"; then
439         AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
440         AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
441     fi
442     if test "x$enable_tiff" = "xyes"; then
443             AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
444     else
445             AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
446     fi 
447 fi
448
449 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
450 dnl ================== end of tiff checks ============================================
451
452 dnl ================== djvu checks ===================================================
453
454 AC_ARG_ENABLE(djvu,
455             [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=yes)
456
457 if test "x$enable_djvu" = "xyes"; then
458     DJVULIBRE_REQUIRED=3.5.17
459     PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
460
461     if test "x$enable_djvu" = "xyes"; then
462         AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
463     else
464         AC_MSG_WARN([   
465 ** Djvu support is disabled since a recent version of the djvulibre 
466 ** library was not found. You need at least djvulibre-3.5.17 which 
467 ** can be found on http://djvulibre.djvuzone.org 
468 ])
469     fi 
470 fi
471
472 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
473
474 dnl ================== End of djvu checks ===================================================
475
476 dnl ================== dvi checks ===================================================
477
478 AC_ARG_ENABLE(dvi,
479             [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=yes)
480
481 AC_ARG_ENABLE(t1lib,
482             [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
483
484 if test "x$enable_dvi" = "xyes"; then
485     AC_C_CONST
486     AC_C_INLINE
487     AC_TYPE_SIZE_T
488     AC_CHECK_SIZEOF(long, 4)
489     AC_CHECK_SIZEOF(int, 4)
490     AC_CHECK_SIZEOF(short, 2)
491     AC_CHECK_SIZEOF(void *, 4)
492     AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
493
494     if test "x$enable_dvi" = "xyes"; then
495         AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
496     else
497         AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
498     fi
499 fi
500 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
501
502 if test "x$enable_dvi" = "xyes"; then
503     if test "x$enable_type1_fonts" = "xyes"; then
504         AC_CHECK_LIB([t1],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no,[-lm])
505     fi
506
507     if test "x$enable_type1_fonts" = xyes; then
508         AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
509     fi
510 else 
511     enable_type1_fonts=no
512 fi
513 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
514
515 dnl ================== End of dvi checks ===================================================
516
517 dnl ================== pixbuf checks ===================================================
518
519 AC_ARG_ENABLE(pixbuf,
520             [AC_HELP_STRING([--enable-pixbuf], [Compile with support of pixbuf])],enable_pixbuf="$enableval",enable_pixbuf=no)
521 if test "x$enable_pixbuf" = "xyes"; then
522         AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.])
523 fi
524 AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes)
525
526 dnl ================== End of pixbuf checks ===================================================
527
528 dnl ================== comic book checks ===================================================
529  
530 AC_ARG_ENABLE(comics,
531         [AC_HELP_STRING([--enable-comics], [Compile with support for comic book archives])],enable_comics="$enableval",enable_comics=yes)
532 if test "x$enable_comics" = "xyes"; then
533         if test "x$os_win32" = "xyes"; then
534                 # The comics backend is disabled on windows because:
535                 # 1) it uses unix functions from sys/wait.h.
536                 # 2) it uses external decompression tools not generally available on windows.
537                 enable_comics=no
538                 AC_MSG_WARN(The comics backend is not supported on windows.)
539         else
540                 AC_DEFINE([ENABLE_COMICS], [1], [Enable support for comics.])
541         fi
542 fi 
543 AM_CONDITIONAL(ENABLE_COMICS, test x$enable_comics = xyes)
544
545 dnl ================== End of comic book checks ============================================
546
547 dnl ================== impress book checks ===================================================
548
549 AC_ARG_ENABLE(impress,
550         [AC_HELP_STRING([--enable-impress], [Compile with support for impress presentations])],enable_impress="$enableval",enable_impress=no)
551 if test "x$enable_impress" = "xyes"; then
552         AC_DEFINE([ENABLE_IMPRESS], [1], [Enable support for impress.])
553 fi 
554 AM_CONDITIONAL(ENABLE_IMPRESS, test x$enable_impress = xyes)
555
556 dnl ================== End of impress book checks ============================================
557
558 dnl =================== Mime types list ====================================================
559
560 if test "x$enable_pdf" = "xyes" ; then
561         EVINCE_MIME_TYPES="application/pdf;application/x-bzpdf;application/x-gzpdf;"
562 fi
563 if test "x$enable_ps" = "xyes" ; then
564         EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;"
565 fi
566 if test "x$enable_dvi" = "xyes"; then
567         EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-dvi;application/x-bzdvi;application/x-gzdvi;"
568 fi
569 if test "x$enable_djvu" = "xyes"; then
570         EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/vnd.djvu;"
571 fi
572 if test "x$enable_tiff" = "xyes"; then
573         EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/tiff;"
574 fi
575 if test "x$enable_comics" = "xyes"; then
576         EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-cbr;application/x-cbz;application/x-cb7;"
577 fi
578 if test "x$enable_pixbuf" = "xyes"; then
579         EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/*;"
580 fi
581 if test "x$enable_impress" = "xyes"; then
582         EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/vnd.sun.xml.impress;application/vnd.oasis.opendocument.presentation;"
583 fi
584 AC_SUBST(EVINCE_MIME_TYPES)
585
586 AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
587
588 # Backends directory
589
590 AC_SUBST([backenddir],"\$(libdir)/evince/ev_binary_version/backends")
591
592 # Versioning
593
594 AC_SUBST([EV_MAJOR_VERSION],[ev_major_version])
595 AC_SUBST([EV_MINOR_VERSION],[ev_minor_version])
596 AC_SUBST([EV_MICRO_VERSION],[ev_micro_version])
597
598 AC_SUBST([EV_API_VERSION],[ev_api_version])
599 AC_SUBST([EV_BINARY_VERSION],[ev_binary_version])
600
601 AC_SUBST([EV_DOCUMENT_LT_VERSION_INFO],[ev_document_lt_version_info])
602 AC_SUBST([EV_DOCUMENT_LT_CURRENT_MINUS_AGE],[ev_document_lt_current_minus_age])
603 AC_SUBST([EV_VIEW_LT_VERSION_INFO],[ev_view_lt_version_info])
604 AC_SUBST([EV_VIEW_LT_CURRENT_MINUS_AGE],[ev_view_lt_current_minus_age])
605
606 # *****************************************************************************
607
608 SHAVE_INIT([.], [enable])
609
610 AC_CONFIG_FILES([
611 backend/Makefile
612 backend/comics/Makefile
613 backend/djvu/Makefile
614 backend/dvi/Makefile
615 backend/dvi/mdvi-lib/Makefile
616 backend/impress/Makefile
617 backend/pdf/Makefile
618 backend/pixbuf/Makefile
619 backend/ps/Makefile
620 backend/tiff/Makefile
621 cut-n-paste/Makefile
622 cut-n-paste/gedit-message-area/Makefile
623 cut-n-paste/gimpcellrenderertoggle/Makefile
624 cut-n-paste/smclient/Makefile
625 cut-n-paste/toolbar-editor/Makefile
626 cut-n-paste/zoom-control/Makefile
627 cut-n-paste/totem-screensaver/Makefile
628 data/evince.desktop.in
629 data/Makefile
630 data/icons/Makefile
631 data/icons/16x16/Makefile
632 data/icons/16x16/apps/Makefile
633 data/icons/16x16/actions/Makefile
634 data/icons/22x22/Makefile
635 data/icons/22x22/apps/Makefile
636 data/icons/22x22/actions/Makefile
637 data/icons/24x24/Makefile
638 data/icons/24x24/apps/Makefile
639 data/icons/24x24/actions/Makefile
640 data/icons/32x32/Makefile
641 data/icons/32x32/actions/Makefile
642 data/icons/48x48/Makefile
643 data/icons/48x48/apps/Makefile
644 data/icons/48x48/actions/Makefile
645 data/icons/scalable/Makefile
646 data/icons/scalable/apps/Makefile
647 help/Makefile
648 help/reference/Makefile
649 help/reference/libdocument/Makefile
650 help/reference/libdocument/version.xml
651 help/reference/libview/Makefile
652 help/reference/libview/version.xml
653 help/reference/shell/Makefile
654 help/reference/shell/version.xml
655 libdocument/Makefile
656 libdocument/ev-version.h
657 libmisc/Makefile
658 libview/Makefile
659 Makefile
660 po/Makefile.in
661 previewer/Makefile
662 properties/Makefile
663 shave
664 shave-libtool
665 shell/Makefile
666 test/Makefile
667 thumbnailer/Makefile
668 ])
669
670 AC_CONFIG_FILES(evince-document-[]ev_api_version[].pc:evince-document.pc.in)
671 AC_CONFIG_FILES(evince-view-[]ev_api_version[].pc:evince-view.pc.in)
672
673 AC_OUTPUT
674
675 echo "
676 Configure summary:
677         GConf Support......:  $with_gconf
678         Keyring Support....:  $WITH_KEYRING
679         DBUS Support.......:  $enable_dbus
680         Nautilus Plugin....:  $HAVE_NAUTILUS
681         Thumbnailer........:  $ENABLE_THUMBNAILER
682         Previewer..........:  $ENABLE_PREVIEWER
683         Gtk-Doc Support....:  $enable_gtk_doc
684         Debug mode.........:  $enable_debug
685         GObj. Introspection:  $enable_introspection
686
687         PDF Backend........:  $enable_pdf
688         PostScript Backend.:  $enable_ps
689         TIFF Backend.......:  $enable_tiff
690         DJVU Backend.......:  $enable_djvu
691         DVI Backend........:  $enable_dvi
692         Pixbuf Backend.....:  $enable_pixbuf
693         Comics Backend.....:  $enable_comics
694         Impress Backend....:  $enable_impress
695 "