1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([Evince],[0.6.1],[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 AC_MSG_WARN("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
214 AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
215 dnl ================== end of pdf checks ============================================
217 dnl ================== ggv checks ===================================================
219 [AC_HELP_STRING([--disable-ps], [Compile without PostScript backend])],enable_ps=$enableval,enable_ps="yes")
221 if test x$enable_ps = xyes; then
222 AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
225 AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
227 if test x$enable_ps = xyes; then
229 dnl check for GS version
230 AC_MSG_CHECKING(for Ghostscript version...)
231 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
232 AC_MSG_RESULT(found $GS_VERSION)
233 if test "$GS_VERSION" -lt "7"; then
234 AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
237 AC_ARG_WITH(gs-aa-params,
238 [AC_HELP_STRING([--with-gs-aa-params], [Define antialiasing params for ghostscript])],AA_PARAMS=$withval,
239 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dDOINTERPOLATE"
241 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
242 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
245 dnl ======================== End of ggv checks =================================
247 dnl ================== tiff checks ===================================================
249 [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
251 if test "x$enable_tiff" = "xyes"; then
252 AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
253 if test "x$enable_tiff" = "xyes"; then
254 AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
255 AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
257 if test "x$enable_tiff" = "xyes"; then
258 AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
259 FRONTEND_LIBS="$FRONTEND_LIBS -ltiff"
260 SHELL_LIBS="$SHELL_LIBS -ltiff"
262 AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
266 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
267 dnl ================== end of tiff checks ============================================
269 dnl ================== djvu checks ===================================================
272 [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=no)
274 if test "x$enable_djvu" = "xyes"; then
276 DJVULIBRE_REQUIRED=3.5.17
278 PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
280 if test "x$enable_djvu" = "xyes"; then
281 AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
284 ** Djvu support is disabled since a recent version of the djvulibre
285 ** library was not found. You need at least djvulibre-3.5.17 which
286 ** can be found on http://djvulibre.djvuzone.org
291 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
293 dnl ================== End of djvu checks ===================================================
295 dnl ================== dvi checks ===================================================
298 [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=no)
301 [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
303 if test "x$enable_dvi" = "xyes"; then
307 AC_CHECK_SIZEOF(long, 4)
308 AC_CHECK_SIZEOF(int, 4)
309 AC_CHECK_SIZEOF(short, 2)
310 AC_CHECK_SIZEOF(void *, 4)
311 AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
313 if test "x$enable_dvi" = "xyes"; then
314 AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
316 AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
319 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
321 if test "x$enable_dvi" = "xyes"; then
322 if test "x$enable_type1_fonts" = "xyes"; then
323 AC_CHECK_LIB([t1],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no,[-lm])
326 if test "x$enable_type1_fonts" = xyes; then
327 AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
330 enable_type1_fonts=no
332 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
334 dnl ================== End of dvi checks ===================================================
336 dnl ================== pixbuf checks ===================================================
338 AC_ARG_ENABLE(pixbuf,
339 [AC_HELP_STRING([--enable-pixbuf], [Compile with support of pixbuf])],enable_pixbuf="$enableval",enable_pixbuf=no)
340 if test "x$enable_pixbuf" = "xyes"; then
341 AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.])
343 AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes)
345 dnl ================== End of pixbuf checks ===================================================
347 dnl ================== comic book checks ===================================================
349 AC_ARG_ENABLE(comics,
350 [AC_HELP_STRING([--enable-comics], [Compile with support for comic book archives])],enable_comics="$enableval",enable_comics=no)
351 if test "x$enable_comics" = "xyes"; then
352 AC_DEFINE([ENABLE_COMICS], [1], [Enable support for comics.])
354 AM_CONDITIONAL(ENABLE_COMICS, test x$enable_comics = xyes)
356 dnl ================== End of comic book checks ============================================
358 dnl ================== impress book checks ===================================================
360 AC_ARG_ENABLE(impress,
361 [AC_HELP_STRING([--enable-impress], [Compile with support for impress presentations])],enable_impress="$enableval",enable_impress=no)
362 if test "x$enable_impress" = "xyes"; then
363 AC_DEFINE([ENABLE_IMPRESS], [1], [Enable support for impress.])
365 AM_CONDITIONAL(ENABLE_IMPRESS, test x$enable_impress = xyes)
367 dnl ================== End of impress book checks ============================================
369 dnl =================== Mime types list ====================================================
371 if test "x$enable_pdf" = "xyes" ; then
372 EVINCE_MIME_TYPES="application/pdf"
374 if test "x$enable_ps" = "xyes" ; then
375 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/postscript;application/x-gzpostscript"
377 if test "x$enable_dvi" = "xyes"; then
378 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-dvi"
380 if test "x$enable_djvu" = "xyes"; then
381 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/vnd.djvu"
383 if test "x$enable_tiff" = "xyes"; then
384 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/tiff"
386 if test "x$enable_comics" = "xyes"; then
387 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-cbr;application/x-cbz"
389 if test "x$enable_pixbuf" = "xyes"; then
390 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/*"
392 if test "x$enable_impress" = "xyes"; then
393 EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/vnd.sun.xml.impress;application/vnd.oasis.opendocument.presentation"
395 AC_SUBST(EVINCE_MIME_TYPES)
401 cut-n-paste/recent-files/Makefile
402 cut-n-paste/toolbar-editor/Makefile
403 cut-n-paste/zoom-control/Makefile
404 cut-n-paste/totem-screensaver/Makefile
405 data/evince.desktop.in
406 data/icons/16x16/Makefile
407 data/icons/22x22/Makefile
408 data/icons/24x24/Makefile
409 data/icons/48x48/Makefile
411 data/icons/scalable/Makefile
415 dvi/mdvi-lib/Makefile
435 Print Support......: $enable_print
436 DBUS Support.......: $enable_dbus
437 Nautilus Plugin....: $HAVE_NAUTILUS
439 PDF Backend........: $enable_pdf
440 PostScript Backend.: $enable_ps
441 TIFF Backend.......: $enable_tiff
442 DJVU Backend.......: $enable_djvu
443 DVI Backend........: $enable_dvi
444 Pixbuf Backend.....: $enable_pixbuf
445 Comics Backend.....: $enable_comics
446 Impress Backend....: $enable_impress