1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([Evince],[2.22.1.1],[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
108 [AC_HELP_STRING([--enable-dbus], [Compile with support for dbus])],
109 enable_dbus="$enableval",enable_dbus=yes)
110 if test "x$enable_dbus" != "xno"; then
111 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
112 [enable_dbus=yes],[enable_dbus=no])
114 if test "x$enable_dbus" = "xno"; then
115 AC_MSG_WARN([DBUS support is disabled since dbus $DBUS_GLIB_REQUIRED or higher was not found])
118 if test "x$enable_dbus" = "xyes" ; then
119 AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
121 if test x$DBUS_BINDING_TOOL = "xno" ; then
122 AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
125 AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
129 AC_SUBST([DBUS_CFLAGS])
130 AC_SUBST([DBUS_LIBS])
132 LIB_CFLAGS="$LIB_CFLAGS $GNOME_CFLAGS"
133 LIB_LIBS="$LIB_LIBS $GNOME_LIBS"
137 BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
138 AC_SUBST(BACKEND_CFLAGS)
139 AC_SUBST(BACKEND_LIBS)
141 SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $GNOMEUI_CFLAGS $KEYRING_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
142 SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $GNOMEUI_LIBS $KEYRING_LIBS -lz"
143 AC_SUBST(SHELL_CFLAGS)
146 FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS $GNOME_CFLAGS"
147 FRONTEND_LIBS="$FRONTEND_CORE_LIBS $GNOME_LIBS -lz"
148 AC_SUBST(FRONTEND_CFLAGS)
149 AC_SUBST(FRONTEND_LIBS)
151 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
152 AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
154 dnl Check for Nautilus property page build
155 AC_ARG_ENABLE(nautilus,
156 AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
157 [case "${enableval}" in
158 yes) ENABLE_NAUTILUS=yes ;;
159 no) ENABLE_NAUTILUS=no ;;
160 *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
162 [ENABLE_NAUTILUS=yes]) dnl Default value
164 if test x$ENABLE_NAUTILUS = "xyes" ; then
165 PKG_CHECK_MODULES(NAUTILUS, gtk+-x11-2.0 $MM gthread-2.0 libnautilus-extension,
166 [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
167 NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
168 AC_SUBST(NAUTILUS_EXTENSION_DIR)
171 AC_SUBST(NAUTILUS_CFLAGS)
172 AC_SUBST(NAUTILUS_LIBS)
173 if test x$HAVE_NAUTILUS = "xyes"; then
174 AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
176 AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
179 dnl Check for thumbnailer build
180 AC_ARG_ENABLE(thumbnailer,
181 AC_HELP_STRING([--disable-thumbnailer],[disable the GNOME thumbnailer]),
182 [case "${enableval}" in
183 yes) ENABLE_THUMBNAILER=yes ;;
184 no) ENABLE_THUMBNAILER=no ;;
185 *) AC_MSG_ERROR(bad value ${enableval} for --enable-thumbnailer) ;;
187 [ENABLE_THUMBNAILER=yes]) dnl Default value
188 AM_CONDITIONAL(ENABLE_THUMBNAILER, test x$ENABLE_THUMBNAILER = "xyes")
190 dnl GConf configuration
193 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
194 if test "x$GCONFTOOL" = "xno"; then
195 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
198 dnl ================== portability checks ===========================================
201 AC_CHECK_HEADERS([execinfo.h])
203 AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
204 AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
205 ],[],[#include <langinfo.h>])
207 dnl ================== pdf checks ===================================================
209 [AC_HELP_STRING([--enable-pdf], [Compile with pdf support])],enable_pdf="$enableval",enable_pdf=yes)
211 if test "x$enable_pdf" = "xyes"; then
212 POPPLER_REQUIRED=0.8.0
213 PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED,enable_pdf=yes,enable_pdf=no)
215 if test "x$enable_pdf" = "xyes"; then
216 AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.])
217 SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS"
218 SHELL_CFLAGS="$SHELL_CFLAGS $POPPLER_CFLAGS"
220 evince_save_LIBS=$LIBS
221 LIBS="$LIBS $POPPLER_LIBS"
222 AC_CHECK_FUNCS(poppler_page_render)
223 LIBS=$evince_save_LIBS
225 PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
226 if test x$enable_cairo_pdf = xyes; then
227 AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
230 PKG_CHECK_MODULES(CAIRO_PS, cairo-ps, enable_cairo_ps=yes, enable_cairo_ps=no)
231 if test x$enable_cairo_ps = xyes; then
232 AC_DEFINE([HAVE_CAIRO_PS], [1], [defined if cairo-ps is available])
235 AC_MSG_WARN("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
239 AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
240 dnl ================== end of pdf checks ============================================
242 dnl libspectre (used by ps and dvi backends)
243 SPECTRE_REQUIRED=0.2.0
244 PKG_CHECK_MODULES(SPECTRE, libspectre >= $SPECTRE_REQUIRED,have_spectre=yes,have_spectre=no)
245 AM_CONDITIONAL(HAVE_SPECTRE, test x$have_spectre = xyes)
246 if test "x$have_spectre" = "xyes"; then
247 AC_DEFINE([HAVE_SPECTRE], [1], [Have libspectre])
250 dnl ================== ps checks ====================================================
252 [AC_HELP_STRING([--disable-ps], [Compile without PostScript backend])],enable_ps=$enableval,enable_ps="yes")
254 if test "x$enable_ps" = "xyes"; then
255 if test "x$have_spectre = xyes"; then
256 AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
259 AC_MSG_WARN([PS support is disabled since libspectre (version >= $SPECTRE_REQUIRED) is needed])
262 AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
263 dnl ======================== End of ps checks ===================================
265 dnl ================== tiff checks ===================================================
267 [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
269 if test "x$enable_tiff" = "xyes"; then
270 AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
271 if test "x$enable_tiff" = "xyes"; then
272 AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
273 AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
275 if test "x$enable_tiff" = "xyes"; then
276 AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
278 AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
282 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
283 dnl ================== end of tiff checks ============================================
285 dnl ================== djvu checks ===================================================
288 [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=yes)
290 if test "x$enable_djvu" = "xyes"; then
291 DJVULIBRE_REQUIRED=3.5.17
292 PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
294 if test "x$enable_djvu" = "xyes"; then
295 AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
298 ** Djvu support is disabled since a recent version of the djvulibre
299 ** library was not found. You need at least djvulibre-3.5.17 which
300 ** can be found on http://djvulibre.djvuzone.org
305 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
307 dnl ================== End of djvu checks ===================================================
309 dnl ================== dvi checks ===================================================
312 [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=yes)
315 [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
317 if test "x$enable_dvi" = "xyes"; then
321 AC_CHECK_SIZEOF(long, 4)
322 AC_CHECK_SIZEOF(int, 4)
323 AC_CHECK_SIZEOF(short, 2)
324 AC_CHECK_SIZEOF(void *, 4)
325 AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
327 if test "x$enable_dvi" = "xyes"; then
328 AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
330 AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
333 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
335 if test "x$enable_dvi" = "xyes"; then
336 if test "x$enable_type1_fonts" = "xyes"; then
337 AC_CHECK_LIB([t1],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no,[-lm])
340 if test "x$enable_type1_fonts" = xyes; then
341 AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
344 enable_type1_fonts=no
346 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
348 dnl ================== End of dvi checks ===================================================
350 dnl ================== pixbuf checks ===================================================
352 AC_ARG_ENABLE(pixbuf,
353 [AC_HELP_STRING([--enable-pixbuf], [Compile with support of pixbuf])],enable_pixbuf="$enableval",enable_pixbuf=no)
354 if test "x$enable_pixbuf" = "xyes"; then
355 AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.])
357 AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes)
359 dnl ================== End of pixbuf checks ===================================================
361 dnl ================== comic book checks ===================================================
363 AC_ARG_ENABLE(comics,
364 [AC_HELP_STRING([--enable-comics], [Compile with support for comic book archives])],enable_comics="$enableval",enable_comics=yes)
365 if test "x$enable_comics" = "xyes"; then
366 AC_DEFINE([ENABLE_COMICS], [1], [Enable support for comics.])
368 AM_CONDITIONAL(ENABLE_COMICS, test x$enable_comics = xyes)
370 dnl ================== End of comic book checks ============================================
372 dnl ================== impress book checks ===================================================
374 AC_ARG_ENABLE(impress,
375 [AC_HELP_STRING([--enable-impress], [Compile with support for impress presentations])],enable_impress="$enableval",enable_impress=no)
376 if test "x$enable_impress" = "xyes"; then
377 AC_DEFINE([ENABLE_IMPRESS], [1], [Enable support for impress.])
379 AM_CONDITIONAL(ENABLE_IMPRESS, test x$enable_impress = xyes)
381 dnl ================== End of impress book checks ============================================
383 dnl =================== Mime types list ====================================================
385 if test "x$enable_pdf" = "xyes" ; then
386 EVINCE_MIME_TYPES="application/pdf;application/x-bzpdf;application/x-gzpdf;"
388 if test "x$enable_ps" = "xyes" ; then
389 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;"
391 if test "x$enable_dvi" = "xyes"; then
392 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-dvi;application/x-bzdvi;application/x-gzdvi;"
394 if test "x$enable_djvu" = "xyes"; then
395 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/vnd.djvu;"
397 if test "x$enable_tiff" = "xyes"; then
398 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/tiff;"
400 if test "x$enable_comics" = "xyes"; then
401 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-cbr;application/x-cbz;"
403 if test "x$enable_pixbuf" = "xyes"; then
404 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/*;"
406 if test "x$enable_impress" = "xyes"; then
407 EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/vnd.sun.xml.impress;application/vnd.oasis.opendocument.presentation;"
409 AC_SUBST(EVINCE_MIME_TYPES)
413 backend/comics/Makefile
414 backend/djvu/Makefile
416 backend/dvi/mdvi-lib/Makefile
417 backend/impress/Makefile
419 backend/pixbuf/Makefile
421 backend/tiff/Makefile
423 cut-n-paste/gedit-message-area/Makefile
424 cut-n-paste/toolbar-editor/Makefile
425 cut-n-paste/zoom-control/Makefile
426 cut-n-paste/totem-screensaver/Makefile
427 data/evince.desktop.in
430 data/icons/16x16/Makefile
431 data/icons/16x16/apps/Makefile
432 data/icons/16x16/actions/Makefile
433 data/icons/22x22/Makefile
434 data/icons/22x22/apps/Makefile
435 data/icons/22x22/actions/Makefile
436 data/icons/24x24/Makefile
437 data/icons/24x24/apps/Makefile
438 data/icons/24x24/actions/Makefile
439 data/icons/32x32/Makefile
440 data/icons/32x32/actions/Makefile
441 data/icons/48x48/Makefile
442 data/icons/48x48/apps/Makefile
443 data/icons/48x48/actions/Makefile
444 data/icons/scalable/Makefile
445 data/icons/scalable/apps/Makefile
447 help/reference/Makefile
448 help/reference/version.xml
462 GNOME Support......: $WITH_GNOME
463 Keyring Support....: $WITH_KEYRING
464 DBUS Support.......: $enable_dbus
465 Nautilus Plugin....: $HAVE_NAUTILUS
466 Thumbnailer........: $ENABLE_THUMBNAILER
467 Gtk-Doc Support....: $enable_gtk_doc
469 PDF Backend........: $enable_pdf
470 PostScript Backend.: $enable_ps
471 TIFF Backend.......: $enable_tiff
472 DJVU Backend.......: $enable_djvu
473 DVI Backend........: $enable_dvi
474 Pixbuf Backend.....: $enable_pixbuf
475 Comics Backend.....: $enable_comics
476 Impress Backend....: $enable_impress