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