1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([Evince],[0.7.0],[http://bugzilla.gnome.org/enter_bug.cgi?product=evince],[evince])
5 AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip])
7 AM_CONFIG_HEADER(config.h)
18 IT_PROG_INTLTOOL([0.35.0])
19 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
20 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
24 GNOME_MAINTAINER_MODE_DEFINES
25 GNOME_COMPILE_WARNINGS
29 GETTEXT_PACKAGE=evince
30 AC_SUBST(GETTEXT_PACKAGE)
31 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
34 dnl Check dependencies
36 # LIB_CFLAGS for helpers and generic widgets. (lib, cut-and-paste)
37 # BACKEND_CFLAGS for backend implementations.
38 # FRONTEND_CFLAGS for frontend implementations. (properties, thumbnailer)
40 # SHELL_CFLAGS for shell implementation.
43 DBUS_GLIB_REQUIRED=0.33
45 KEYRING_REQUIRED=0.4.0
47 LIBGNOMEUI_REQUIRED=2.14.0
48 LIBGNOMEPRINTUI_REQUIRED=2.6.0
49 GNOME_ICON_THEME_REQUIRED=2.17.1
51 GTK_PRINT_REQUIRED=2.10.0
53 PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
54 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED gnome-vfs-2.0)
55 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED libglade-2.0)
56 PKG_CHECK_MODULES(SHELL_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0 gnome-keyring-1 >= $KEYRING_REQUIRED)
58 BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
59 AC_SUBST(BACKEND_CFLAGS)
61 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
62 AC_SUBST(GLIB_GENMARSHAL)
64 dnl ========= Print support
66 [AC_HELP_STRING([--with-print=no/gtk/gnome/auto], [Compile with print support [default=auto]])],
70 PKG_CHECK_MODULES(GNOME_PRINT,
71 libgnomeprintui-2.2 >= $LIBGNOMEPRINTUI_REQUIRED,
72 enable_gnome_print=yes, enable_gnome_print=no)
73 PKG_CHECK_MODULES(GTK_PRINT,
74 gtk+-unix-print-2.0 >= $GTK_PRINT_REQUIRED,
75 enable_gtk_print=yes, enable_gtk_print=no)
77 if test x$PRINT = xgnome -a x$enable_gnome_print = xyes; then
80 if test x$PRINT = xgtk -a x$enable_gtk_print = xyes; then
83 if test x$PRINT = xauto; then
84 if test x$enable_gtk_print = xyes; then
87 if test x$enable_gnome_print = xyes; then
95 if test x$enable_print = xgnome; then
96 AC_SUBST(GNOME_PRINT_CFLAGS)
97 AC_SUBST(GNOME_PRINT_LIBS)
98 AC_DEFINE([WITH_GNOME_PRINT],[1],[Enable GNOME Print Support.])
99 AC_DEFINE([WITH_PRINT],[1],[Enable Print Support.])
102 if test x$enable_print = xgtk; then
103 AC_SUBST(GTK_PRINT_CFLAGS)
104 AC_SUBST(GTK_PRINT_LIBS)
105 AC_DEFINE([WITH_GTK_PRINT],[1],[Enable GTK Print Support.])
106 AC_DEFINE([WITH_PRINT],[1],[Enable Print Support.])
109 AM_CONDITIONAL(WITH_GNOME_PRINT, test x$enable_print = xgnome)
110 AM_CONDITIONAL(WITH_GTK_PRINT, test x$enable_print = xgtk)
113 dnl ========= Check for DBUS
114 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
115 [enable_dbus=yes],[enable_dbus=no])
116 AC_SUBST([DBUS_CFLAGS])
117 AC_SUBST([DBUS_LIBS])
119 if test "x$enable_dbus" = "xno"; then
120 AC_MSG_WARN([DBUS support is disabled since dbus $DBUS_GLIB_REQUIRED or higher was not found])
123 if test "x$enable_dbus" = "xyes" ; then
124 AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
126 if test x$DBUS_BINDING_TOOL = "xno" ; then
127 AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
130 AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
132 DBUS_VERSION=`$PKG_CONFIG --modversion dbus-glib-1 | sed 's/0\.\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)/\1/'`
133 AC_DEFINE_UNQUOTED(DBUS_VERSION, $DBUS_VERSION, [DBUS version.])
136 SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
137 SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS -lz"
138 AC_SUBST(SHELL_CFLAGS)
141 FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS"
142 FRONTEND_LIBS="$FRONTEND_CORE_LIBS -lz"
143 AC_SUBST(FRONTEND_CFLAGS)
144 AC_SUBST(FRONTEND_LIBS)
146 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
147 AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
149 dnl Check for Nautilus property page build
150 AC_ARG_ENABLE(nautilus,
151 AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
152 [case "${enableval}" in
153 yes) ENABLE_NAUTILUS=yes ;;
154 no) ENABLE_NAUTILUS=no ;;
155 *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
157 [ENABLE_NAUTILUS=yes]) dnl Default value
159 if test x$ENABLE_NAUTILUS = "xyes" ; then
160 PKG_CHECK_MODULES(NAUTILUS, gtk+-x11-2.0 $MM gthread-2.0 libnautilus-extension,
161 [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
164 AC_SUBST(NAUTILUS_CFLAGS)
165 AC_SUBST(NAUTILUS_LIBS)
166 if test x$HAVE_NAUTILUS = "xyes"; then
167 AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
169 AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
171 dnl Check for GtkRecent
172 PKG_CHECK_MODULES(GTK_RECENT, gtk+-2.0 >= 2.10.0,
173 [HAVE_GTK_RECENT=yes], [HAVE_GTK_RECENT=no])
174 if test x$HAVE_GTK_RECENT = xyes; then
175 AC_DEFINE([HAVE_GTK_RECENT], [1], [defined if GtkRecent is available])
177 AM_CONDITIONAL(HAVE_GTK_RECENT, test x$HAVE_GTK_RECENT = "xyes")
179 dnl GConf configuration
182 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
183 if test "x$GCONFTOOL" = "xno"; then
184 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
187 dnl ================== portability checks ===========================================
190 AC_CHECK_HEADERS([execinfo.h])
192 dnl ================== pdf checks ===================================================
194 [AC_HELP_STRING([--enable-pdf], [Compile with pdf support])],enable_pdf="$enableval",enable_pdf=yes)
196 if test "x$enable_pdf" = "xyes"; then
197 POPPLER_REQUIRED=0.5.4
198 PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED,enable_pdf=yes,enable_pdf=no)
200 if test "x$enable_pdf" = "xyes"; then
201 AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.])
202 FRONTEND_LIBS="$FRONTEND_LIBS $POPPLER_LIBS"
203 SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS"
204 SHELL_CFLAGS="$SHELL_CFLAGS $POPPLER_CFLAGS"
205 evince_save_LIBS=$LIBS
206 LIBS="$LIBS $FRONTEND_LIBS"
207 AC_CHECK_FUNCS(poppler_page_render)
208 LIBS=$evince_save_LIBS
210 PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
211 if test x$enable_cairo_pdf == xyes; then
212 AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
215 AC_MSG_WARN("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
219 AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
220 dnl ================== end of pdf checks ============================================
222 dnl ================== ggv checks ===================================================
224 [AC_HELP_STRING([--disable-ps], [Compile without PostScript backend])],enable_ps=$enableval,enable_ps="yes")
226 if test x$enable_ps = xyes; then
227 AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
230 AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
232 if test x$enable_ps = xyes; then
234 dnl check for GS version
235 AC_MSG_CHECKING(for Ghostscript version...)
236 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
237 AC_MSG_RESULT(found $GS_VERSION)
238 if test "$GS_VERSION" -lt "7"; then
239 AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
242 AC_ARG_WITH(gs-aa-params,
243 [AC_HELP_STRING([--with-gs-aa-params], [Define antialiasing params for ghostscript])],AA_PARAMS=$withval,
244 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dDOINTERPOLATE"
246 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
247 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
250 dnl ======================== End of ggv checks =================================
252 dnl ================== tiff checks ===================================================
254 [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
256 if test "x$enable_tiff" = "xyes"; then
257 AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
258 if test "x$enable_tiff" = "xyes"; then
259 AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
260 AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
262 if test "x$enable_tiff" = "xyes"; then
263 AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
264 FRONTEND_LIBS="$FRONTEND_LIBS -ltiff"
265 SHELL_LIBS="$SHELL_LIBS -ltiff"
267 AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
271 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
272 dnl ================== end of tiff checks ============================================
274 dnl ================== djvu checks ===================================================
277 [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=no)
279 if test "x$enable_djvu" = "xyes"; then
281 DJVULIBRE_REQUIRED=3.5.17
283 PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
285 if test "x$enable_djvu" = "xyes"; then
286 AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
289 ** Djvu support is disabled since a recent version of the djvulibre
290 ** library was not found. You need at least djvulibre-3.5.17 which
291 ** can be found on http://djvulibre.djvuzone.org
296 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
298 dnl ================== End of djvu checks ===================================================
300 dnl ================== dvi checks ===================================================
303 [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=no)
306 [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
308 if test "x$enable_dvi" = "xyes"; then
312 AC_CHECK_SIZEOF(long, 4)
313 AC_CHECK_SIZEOF(int, 4)
314 AC_CHECK_SIZEOF(short, 2)
315 AC_CHECK_SIZEOF(void *, 4)
316 AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
318 if test "x$enable_dvi" = "xyes"; then
319 AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
321 AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
324 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
326 if test "x$enable_dvi" = "xyes"; then
327 if test "x$enable_type1_fonts" = "xyes"; then
328 AC_CHECK_LIB([t1],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no,[-lm])
331 if test "x$enable_type1_fonts" = xyes; then
332 AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
335 enable_type1_fonts=no
337 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
339 dnl ================== End of dvi checks ===================================================
341 dnl ================== pixbuf checks ===================================================
343 AC_ARG_ENABLE(pixbuf,
344 [AC_HELP_STRING([--enable-pixbuf], [Compile with support of pixbuf])],enable_pixbuf="$enableval",enable_pixbuf=no)
345 if test "x$enable_pixbuf" = "xyes"; then
346 AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.])
348 AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes)
350 dnl ================== End of pixbuf checks ===================================================
352 dnl ================== comic book checks ===================================================
354 AC_ARG_ENABLE(comics,
355 [AC_HELP_STRING([--enable-comics], [Compile with support for comic book archives])],enable_comics="$enableval",enable_comics=no)
356 if test "x$enable_comics" = "xyes"; then
357 AC_DEFINE([ENABLE_COMICS], [1], [Enable support for comics.])
359 AM_CONDITIONAL(ENABLE_COMICS, test x$enable_comics = xyes)
361 dnl ================== End of comic book checks ============================================
363 dnl ================== impress book checks ===================================================
365 AC_ARG_ENABLE(impress,
366 [AC_HELP_STRING([--enable-impress], [Compile with support for impress presentations])],enable_impress="$enableval",enable_impress=no)
367 if test "x$enable_impress" = "xyes"; then
368 AC_DEFINE([ENABLE_IMPRESS], [1], [Enable support for impress.])
370 AM_CONDITIONAL(ENABLE_IMPRESS, test x$enable_impress = xyes)
372 dnl ================== End of impress book checks ============================================
374 dnl =================== Mime types list ====================================================
376 if test "x$enable_pdf" = "xyes" ; then
377 EVINCE_MIME_TYPES="application/pdf"
379 if test "x$enable_ps" = "xyes" ; then
380 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/postscript;application/x-gzpostscript"
382 if test "x$enable_dvi" = "xyes"; then
383 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-dvi"
385 if test "x$enable_djvu" = "xyes"; then
386 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/vnd.djvu"
388 if test "x$enable_tiff" = "xyes"; then
389 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/tiff"
391 if test "x$enable_comics" = "xyes"; then
392 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-cbr;application/x-cbz"
394 if test "x$enable_pixbuf" = "xyes"; then
395 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/*"
397 if test "x$enable_impress" = "xyes"; then
398 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/vnd.sun.xml.impress;application/vnd.oasis.opendocument.presentation"
400 AC_SUBST(EVINCE_MIME_TYPES)
406 cut-n-paste/recent-files/Makefile
407 cut-n-paste/toolbar-editor/Makefile
408 cut-n-paste/zoom-control/Makefile
409 cut-n-paste/totem-screensaver/Makefile
410 data/evince.desktop.in
411 data/icons/16x16/Makefile
412 data/icons/22x22/Makefile
413 data/icons/24x24/Makefile
414 data/icons/48x48/Makefile
416 data/icons/scalable/Makefile
420 dvi/mdvi-lib/Makefile
440 Print Support......: $enable_print
441 DBUS Support.......: $enable_dbus
442 Nautilus Plugin....: $HAVE_NAUTILUS
444 PDF Backend........: $enable_pdf
445 PostScript Backend.: $enable_ps
446 TIFF Backend.......: $enable_tiff
447 DJVU Backend.......: $enable_djvu
448 DVI Backend........: $enable_dvi
449 Pixbuf Backend.....: $enable_pixbuf
450 Comics Backend.....: $enable_comics
451 Impress Backend....: $enable_impress