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