1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([Evince],[2.21.90],[http://bugzilla.gnome.org/enter_bug.cgi?product=evince],[evince])
5 AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip])
8 AC_SUBST(EV_API_VERSION)
10 AM_CONFIG_HEADER(config.h)
21 IT_PROG_INTLTOOL([0.35.0])
22 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
23 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
27 GNOME_MAINTAINER_MODE_DEFINES
28 GNOME_COMPILE_WARNINGS
34 GETTEXT_PACKAGE=evince
35 AC_SUBST(GETTEXT_PACKAGE)
36 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
39 dnl Check dependencies
41 # LIB_CFLAGS for helpers and generic widgets. (libdocument, cut-and-paste)
42 # BACKEND_CFLAGS for backend implementations.
43 # FRONTEND_CFLAGS for frontend implementations. (properties, thumbnailer)
45 # SHELL_CFLAGS for shell implementation.
48 DBUS_GLIB_REQUIRED=0.70
51 KEYRING_REQUIRED=0.4.0
53 LIBGNOMEUI_REQUIRED=2.14.0
54 LIBGNOME_REQUIRED=2.14.0
55 GNOME_ICON_THEME_REQUIRED=2.17.1
58 PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
59 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED)
60 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
61 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 libglade-2.0 gconf-2.0)
63 BACKEND_LIBTOOL_FLAGS="-module -avoid-version"
64 AC_SUBST(BACKEND_LIBTOOL_FLAGS)
66 dnl ===== Check special functions
67 evince_save_LIBS=$LIBS
68 LIBS="$LIBS $BACKEND_LIBS"
69 AC_CHECK_FUNCS(cairo_format_stride_for_width)
70 LIBS=$evince_save_LIBS
73 AC_HELP_STRING([--without-keyring],[disable the use of gnome-keyring]),
75 yes) WITH_KEYRING=yes ;;
76 no) WITH_KEYRING=no ;;
77 *) AC_MSG_ERROR(bad value ${withval} for --with-keyring) ;;
79 [WITH_KEYRING=yes]) dnl Default value
80 AM_CONDITIONAL(WITH_KEYRING, test x$WITH_KEYRING = "xyes")
82 if test x$WITH_KEYRING = "xyes"; then
83 PKG_CHECK_MODULES(KEYRING, gnome-keyring-1 >= $KEYRING_REQUIRED)
84 AC_DEFINE([WITH_KEYRING],[1],[Define if KEYRING support is enabled])
88 AC_HELP_STRING([--without-libgnome],[disable the use of libgnome]),
90 yes) WITH_GNOME=yes ;;
92 *) AC_MSG_ERROR(bad value ${withval} for --with-libgnome) ;;
94 [WITH_GNOME=yes]) dnl Default value
95 AM_CONDITIONAL(WITH_GNOME, test x$WITH_GNOME = "xyes")
97 if test x$WITH_GNOME = "xyes"; then
98 PKG_CHECK_MODULES(GNOME, libgnome-2.0 >= $LIBGNOME_REQUIRED)
99 PKG_CHECK_MODULES(GNOMEUI, libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
100 AC_DEFINE([WITH_GNOME],[1],[Define if GNOME support is enabled])
103 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
104 AC_SUBST(GLIB_GENMARSHAL)
106 dnl ========= Check for DBUS
107 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
108 [enable_dbus=yes],[enable_dbus=no])
109 AC_SUBST([DBUS_CFLAGS])
110 AC_SUBST([DBUS_LIBS])
112 if test "x$enable_dbus" = "xno"; then
113 AC_MSG_WARN([DBUS support is disabled since dbus $DBUS_GLIB_REQUIRED or higher was not found])
116 if test "x$enable_dbus" = "xyes" ; then
117 AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
119 if test x$DBUS_BINDING_TOOL = "xno" ; then
120 AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
123 AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
126 LIB_CFLAGS="$LIB_CFLAGS $GNOME_CFLAGS"
127 LIB_LIBS="$LIB_LIBS $GNOME_LIBS"
131 BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
132 AC_SUBST(BACKEND_CFLAGS)
133 AC_SUBST(BACKEND_LIBS)
135 SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $GNOMEUI_CFLAGS $KEYRING_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
136 SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $GNOMEUI_LIBS $KEYRING_LIBS -lz"
137 AC_SUBST(SHELL_CFLAGS)
140 FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS $GNOME_CFLAGS"
141 FRONTEND_LIBS="$FRONTEND_CORE_LIBS $GNOME_LIBS -lz"
142 AC_SUBST(FRONTEND_CFLAGS)
143 AC_SUBST(FRONTEND_LIBS)
145 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
146 AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
148 dnl Check for Nautilus property page build
149 AC_ARG_ENABLE(nautilus,
150 AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
151 [case "${enableval}" in
152 yes) ENABLE_NAUTILUS=yes ;;
153 no) ENABLE_NAUTILUS=no ;;
154 *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
156 [ENABLE_NAUTILUS=yes]) dnl Default value
158 if test x$ENABLE_NAUTILUS = "xyes" ; then
159 PKG_CHECK_MODULES(NAUTILUS, gtk+-x11-2.0 $MM gthread-2.0 libnautilus-extension,
160 [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
161 NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
162 AC_SUBST(NAUTILUS_EXTENSION_DIR)
165 AC_SUBST(NAUTILUS_CFLAGS)
166 AC_SUBST(NAUTILUS_LIBS)
167 if test x$HAVE_NAUTILUS = "xyes"; then
168 AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
170 AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
173 dnl Check for thumbnailer build
174 AC_ARG_ENABLE(thumbnailer,
175 AC_HELP_STRING([--disable-thumbnailer],[disable the GNOME thumbnailer]),
176 [case "${enableval}" in
177 yes) ENABLE_THUMBNAILER=yes ;;
178 no) ENABLE_THUMBNAILER=no ;;
179 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thumbnailer) ;;
181 [ENABLE_THUMBNAILER=yes]) dnl Default value
182 AM_CONDITIONAL(ENABLE_THUMBNAILER, test x$ENABLE_THUMBNAILER = "xyes")
184 dnl GConf configuration
187 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
188 if test "x$GCONFTOOL" = "xno"; then
189 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
192 dnl ================== portability checks ===========================================
195 AC_CHECK_HEADERS([execinfo.h])
197 AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
198 AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
199 ],[],[#include <langinfo.h>])
201 dnl ================== pdf checks ===================================================
203 [AC_HELP_STRING([--enable-pdf], [Compile with pdf support])],enable_pdf="$enableval",enable_pdf=yes)
205 if test "x$enable_pdf" = "xyes"; then
207 PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED,enable_pdf=yes,enable_pdf=no)
209 if test "x$enable_pdf" = "xyes"; then
210 AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.])
211 SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS"
212 SHELL_CFLAGS="$SHELL_CFLAGS $POPPLER_CFLAGS"
214 evince_save_LIBS=$LIBS
215 LIBS="$LIBS $POPPLER_LIBS"
216 AC_CHECK_FUNCS(poppler_page_render)
217 AC_CHECK_FUNCS(poppler_page_render_for_printing)
218 AC_CHECK_FUNCS(poppler_page_get_image)
219 LIBS=$evince_save_LIBS
221 PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
222 if test x$enable_cairo_pdf == xyes; then
223 AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
226 PKG_CHECK_MODULES(CAIRO_PS, cairo-ps, enable_cairo_ps=yes, enable_cairo_ps=no)
227 if test x$enable_cairo_ps == xyes; then
228 AC_DEFINE([HAVE_CAIRO_PS], [1], [defined if cairo-ps is available])
231 AC_MSG_WARN("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
235 AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
236 dnl ================== end of pdf checks ============================================
237 SPECTRE_REQUIRED=0.2.0
239 dnl libspectre (used by ps and dvi backends)
240 PKG_CHECK_MODULES(SPECTRE, libspectre >= $SPECTRE_REQUIRED,have_spectre=yes,have_spectre=no)
241 AM_CONDITIONAL(HAVE_SPECTRE, test x$have_spectre = xyes)
242 if test "x$have_spectre" = "xyes"; then
243 AC_DEFINE([HAVE_SPECTRE], [1], [Have libpectre])
246 dnl ================== ps checks ====================================================
248 [AC_HELP_STRING([--disable-ps], [Compile without PostScript backend])],enable_ps=$enableval,enable_ps="yes")
251 if test x$enable_ps = xyes; then
252 AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
254 if test "x$have_spectre" = "xyes"; then
255 ps_backend="(libspectre)"
257 dnl check for GS version
258 AC_MSG_CHECKING(for Ghostscript version...)
259 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
260 AC_MSG_RESULT(found $GS_VERSION)
261 if test "$GS_VERSION" -lt "7"; then
262 AC_MSG_WARN([PS support is disabled since libspectre (version >= $SPECTRE_REQUIRED) or Ghostscript (version >= 7) are needed])
265 AC_ARG_WITH(gs-aa-params,
266 [AC_HELP_STRING([--with-gs-aa-params], [Define antialiasing params for ghostscript])],AA_PARAMS=$withval,
267 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dDOINTERPOLATE"
269 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
270 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
275 AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
276 dnl ======================== End of ps checks ===================================
278 dnl ================== tiff checks ===================================================
280 [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
282 if test "x$enable_tiff" = "xyes"; then
283 AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
284 if test "x$enable_tiff" = "xyes"; then
285 AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
286 AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
288 if test "x$enable_tiff" = "xyes"; then
289 AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
291 AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
295 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
296 dnl ================== end of tiff checks ============================================
298 dnl ================== djvu checks ===================================================
301 [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=yes)
303 if test "x$enable_djvu" = "xyes"; then
304 DJVULIBRE_REQUIRED=3.5.17
305 PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
307 if test "x$enable_djvu" = "xyes"; then
308 AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
311 ** Djvu support is disabled since a recent version of the djvulibre
312 ** library was not found. You need at least djvulibre-3.5.17 which
313 ** can be found on http://djvulibre.djvuzone.org
318 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
320 dnl ================== End of djvu checks ===================================================
322 dnl ================== dvi checks ===================================================
325 [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=yes)
328 [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
330 if test "x$enable_dvi" = "xyes"; then
334 AC_CHECK_SIZEOF(long, 4)
335 AC_CHECK_SIZEOF(int, 4)
336 AC_CHECK_SIZEOF(short, 2)
337 AC_CHECK_SIZEOF(void *, 4)
338 AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
340 if test "x$enable_dvi" = "xyes"; then
341 AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
343 AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
346 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
348 if test "x$enable_dvi" = "xyes"; then
349 if test "x$enable_type1_fonts" = "xyes"; then
350 AC_CHECK_LIB([t1],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no,[-lm])
353 if test "x$enable_type1_fonts" = xyes; then
354 AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
357 enable_type1_fonts=no
359 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
361 dnl ================== End of dvi checks ===================================================
363 dnl ================== pixbuf checks ===================================================
365 AC_ARG_ENABLE(pixbuf,
366 [AC_HELP_STRING([--enable-pixbuf], [Compile with support of pixbuf])],enable_pixbuf="$enableval",enable_pixbuf=no)
367 if test "x$enable_pixbuf" = "xyes"; then
368 AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.])
370 AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes)
372 dnl ================== End of pixbuf checks ===================================================
374 dnl ================== comic book checks ===================================================
376 AC_ARG_ENABLE(comics,
377 [AC_HELP_STRING([--enable-comics], [Compile with support for comic book archives])],enable_comics="$enableval",enable_comics=yes)
378 if test "x$enable_comics" = "xyes"; then
379 AC_DEFINE([ENABLE_COMICS], [1], [Enable support for comics.])
381 AM_CONDITIONAL(ENABLE_COMICS, test x$enable_comics = xyes)
383 dnl ================== End of comic book checks ============================================
385 dnl ================== impress book checks ===================================================
387 AC_ARG_ENABLE(impress,
388 [AC_HELP_STRING([--enable-impress], [Compile with support for impress presentations])],enable_impress="$enableval",enable_impress=no)
389 if test "x$enable_impress" = "xyes"; then
390 AC_DEFINE([ENABLE_IMPRESS], [1], [Enable support for impress.])
392 AM_CONDITIONAL(ENABLE_IMPRESS, test x$enable_impress = xyes)
394 dnl ================== End of impress book checks ============================================
396 dnl =================== Mime types list ====================================================
398 if test "x$enable_pdf" = "xyes" ; then
399 EVINCE_MIME_TYPES="application/pdf;application/x-bzpdf;application/x-gzpdf;"
401 if test "x$enable_ps" = "xyes" ; then
402 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;"
404 if test "x$enable_dvi" = "xyes"; then
405 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-dvi;"
407 if test "x$enable_djvu" = "xyes"; then
408 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/vnd.djvu;"
410 if test "x$enable_tiff" = "xyes"; then
411 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/tiff;"
413 if test "x$enable_comics" = "xyes"; then
414 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-cbr;application/x-cbz;"
416 if test "x$enable_pixbuf" = "xyes"; then
417 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/*;"
419 if test "x$enable_impress" = "xyes"; then
420 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/vnd.sun.xml.impress;application/vnd.oasis.opendocument.presentation;"
422 AC_SUBST(EVINCE_MIME_TYPES)
426 backend/comics/Makefile
427 backend/djvu/Makefile
429 backend/dvi/mdvi-lib/Makefile
430 backend/impress/Makefile
432 backend/pixbuf/Makefile
434 backend/tiff/Makefile
436 cut-n-paste/gedit-message-area/Makefile
437 cut-n-paste/toolbar-editor/Makefile
438 cut-n-paste/zoom-control/Makefile
439 cut-n-paste/totem-screensaver/Makefile
440 data/evince.desktop.in
443 data/icons/16x16/Makefile
444 data/icons/16x16/apps/Makefile
445 data/icons/16x16/actions/Makefile
446 data/icons/22x22/Makefile
447 data/icons/22x22/apps/Makefile
448 data/icons/22x22/actions/Makefile
449 data/icons/24x24/Makefile
450 data/icons/24x24/apps/Makefile
451 data/icons/24x24/actions/Makefile
452 data/icons/32x32/Makefile
453 data/icons/32x32/actions/Makefile
454 data/icons/48x48/Makefile
455 data/icons/48x48/apps/Makefile
456 data/icons/48x48/actions/Makefile
457 data/icons/scalable/Makefile
458 data/icons/scalable/apps/Makefile
460 help/reference/Makefile
461 help/reference/version.xml
475 GNOME Support......: $WITH_GNOME
476 Keyring Support....: $WITH_KEYRING
477 DBUS Support.......: $enable_dbus
478 Nautilus Plugin....: $HAVE_NAUTILUS
479 Thumbnailer........: $ENABLE_THUMBNAILER
480 Gtk-Doc Support....: $enable_gtk_doc
482 PDF Backend........: $enable_pdf
483 PostScript Backend.: $enable_ps $ps_backend
484 TIFF Backend.......: $enable_tiff
485 DJVU Backend.......: $enable_djvu
486 DVI Backend........: $enable_dvi
487 Pixbuf Backend.....: $enable_pixbuf
488 Comics Backend.....: $enable_comics
489 Impress Backend....: $enable_impress