]> www.fi.muni.cz Git - evince.git/blob - configure.ac
check if dbus-binding-tool is installed. Not the case on current
[evince.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.57)
4 AC_INIT(evince, 0.3.2)
5 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
6
7 dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
8 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
9
10 AM_CONFIG_HEADER(config.h)
11
12 AM_MAINTAINER_MODE
13
14 AM_PROG_LIBTOOL
15
16 AC_ISC_POSIX
17 AC_PROG_CC
18 AM_PROG_CC_STDC
19 AC_PROG_CXX
20 AC_STDC_HEADERS
21 AC_PROG_INTLTOOL
22 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
23 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
24
25 GNOME_DEBUG_CHECK
26
27 ALL_LINGUAS="bg ca cs da de el en_CA en_GB es fi fr hu ja ko lt nb nl no pt_BR ru rw sk sv th uk wa zh_CN zh_TW"
28
29 AM_GLIB_GNU_GETTEXT
30
31 GETTEXT_PACKAGE=AC_PACKAGE_NAME
32 AC_SUBST(GETTEXT_PACKAGE)
33 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
34
35 POPPLER_REQUIRED=0.3.3
36 DBUS_GLIB_REQUIRED=0.33
37
38 PKG_CHECK_MODULES(LIBEVPRIVATE, gtk+-2.0 >= 2.4.0)
39 PKG_CHECK_MODULES(TOOLBAR_EDITOR, gtk+-2.0 >= 2.4.0 libgnomeui-2.0 >= 2.4.0)
40 PKG_CHECK_MODULES(RECENT_FILES, gtk+-2.0 >= 2.4.0 libgnomeui-2.0 >= 2.4.0)
41 PKG_CHECK_MODULES(ZOOM_CONTROL, gtk+-2.0 >= 2.4.0)
42 PKG_CHECK_MODULES(SHELL, gtk+-2.0 >= 2.6.0 libgnomeui-2.0 >= 2.6.0 gnome-vfs-2.0 libgnomeprint-2.2 >= 2.5.1 libgnomeprintui-2.2 libglade-2.0 gconf-2.0 poppler-glib >= $POPPLER_REQUIRED)
43 PKG_CHECK_MODULES(THUMBNAILER, gtk+-2.0 >= 2.6.0 gnome-vfs-2.0 poppler-glib >= $POPPLER_REQUIRED)
44 PKG_CHECK_MODULES(PROPERTIES, gtk+-2.0 >= 2.6.0 libglade-2.0 poppler-glib >= $POPPLER_REQUIRED)
45 PKG_CHECK_MODULES(DVI, gtk+-2.0 >= 2.6.0)
46 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0)
47 PKG_CHECK_MODULES(PS, gtk+-2.0 >= 2.6.0 gnome-vfs-2.0 libgnomeui-2.0)
48 PKG_CHECK_MODULES(POPPLER_GLIB, poppler-glib >= $POPPLER_REQUIRED)
49
50 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
51 AC_SUBST(GLIB_GENMARSHAL)
52
53 PKG_CHECK_EXISTS([dbus-glib-1 >= $DBUS_GLIB_REQUIRED], [enable_dbus=yes],
54                   [AC_MSG_WARN("DBUS support is disabled since dbus 0.33 or higher was not found")
55                   enable_dbus=no])
56
57 if test "x$enable_dbus" = "xyes" ; then
58         PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED])
59         AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
60
61         if test x$DBUS_BINDING_TOOL = "xno" ; then
62                 AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
63         fi                                            
64
65         AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
66         AC_DEFINE([ENABLE_METADATA],[1],[Define if metadata support is enabled])
67
68         DBUS_VERSION=`$PKG_CONFIG --modversion dbus-glib-1 | sed 's/0.\([[0-9]]*\)/\1/'`
69         AC_DEFINE_UNQUOTED(DBUS_VERSION, $DBUS_VERSION, [DBUS version.])
70 fi
71
72 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
73 AM_CONDITIONAL([ENABLE_METADATA], [test "x$enable_dbus" = "xyes"])
74 AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
75
76 dnl Check for Nautilus property page build
77 AC_ARG_ENABLE(nautilus,
78         AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
79         [case "${enableval}" in
80         yes) ENABLE_NAUTILUS=yes ;;
81         no) ENABLE_NAUTILUS=no ;;
82         *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
83         esac],
84         [ENABLE_NAUTILUS=yes]) dnl Default value
85
86 if test x$ENABLE_NAUTILUS = "xyes" ; then
87         PKG_CHECK_MODULES(NAUTILUS, gtk+-x11-2.0 $MM gthread-2.0 libnautilus-extension,
88                         [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
89 fi
90
91 AC_SUBST(NAUTILUS_CFLAGS)
92 AC_SUBST(NAUTILUS_LIBS)
93 if test x$HAVE_NAUTILUS = "xyes"; then
94         AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
95 fi
96 AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
97
98 dnl Compile with disable-deprecated switches
99
100 AC_ARG_ENABLE(deprecated,
101 AC_HELP_STRING([--disable-deprecated],
102                [Don't allow any deprecated GTK+/etc. features.]),
103 set_enable_deprecated="$enableval",[
104 if test -f $srcdir/autogen.sh; then
105         is_cvs_version=true
106         set_enable_deprecated=no
107 else
108         set_enable_deprecated=yes
109         fi
110 ])
111 AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features])
112 if test "$set_enable_deprecated" != "yes"; then
113         AC_MSG_RESULT(yes)
114         EVINCE_DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
115 else
116         AC_MSG_RESULT(no)
117         EVINCE_DISABLE_DEPRECATED=""
118 fi
119 AC_SUBST(EVINCE_DISABLE_DEPRECATED)
120
121 evince_save_LIBS=$LIBS
122 LIBS="$LIBS $GTK_LIBS"
123 AC_CHECK_FUNCS(gtk_icon_view_get_visible_range)
124 LIBS=$evince_save_LIBS
125
126 AM_GCONF_SOURCE_2
127
128 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
129 if test "x$GCONFTOOL" = "xno"; then
130         AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
131 fi
132
133 dnl ================== ggv checks ===================================================
134 AC_ARG_WITH(gs-pkg,
135             [  --with-gs=dir       Directory Where GhostScript package is installed.])
136
137 if test "x$with_gs" = "x"; then
138         AC_PATH_PROG(GS_PROG, gs)
139         if test -z "$GS_PROG"; then
140                 AC_MSG_ERROR(Unable to find GhostScript in the PATH. Provide the full path for GhostScript(--with-gs=PATH). You need to have Ghostscript installed in order to run evince)
141         fi
142 else
143         GS_PROG=$with_gs
144 fi
145
146 AC_DEFINE_UNQUOTED(GS_PATH, "$GS_PROG", [Path to the 'gs' executable.])
147
148
149 dnl check for GS version
150 AC_MSG_CHECKING(for Ghostscript version...)
151 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
152 AC_MSG_RESULT(found $GS_VERSION)
153 if test "$GS_VERSION" -lt "7"; then
154         AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
155 fi
156 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS"
157 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
158 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
159 dnl ======================== End of ggv checks =================================
160
161 dnl ================== tiff checks ===================================================
162 AC_ARG_ENABLE(tiff,
163             [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
164
165 if test "x$enable_tiff" = "xyes"; then
166     AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
167     if test "x$enable_tiff" = "xyes"; then
168         AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
169         AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
170     fi
171     if test "x$enable_tiff" = "xyes"; then
172             AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
173     else
174             AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
175     fi 
176 fi
177
178 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
179 dnl ================== end of tiff checks ============================================
180
181 dnl ================== djvu checks ===================================================
182
183 AC_ARG_ENABLE(djvu,
184             [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=no)
185
186 if test "x$enable_djvu" = "xyes"; then
187     AC_CHECK_HEADERS([libdjvu/ddjvuapi.h],enable_djvu=yes,enable_djvu=no,)
188
189     if test "x$enable_djvu" = "xyes"; then
190         AC_CHECK_LIB([djvulibre],ddjvu_context_create,enable_djvu=yes,enable_djvu=no,"-lpthread")
191         AC_CHECK_LIB([djvulibre],ddjvu_document_get_pageinfo,enable_djvu=yes,enable_djvu=no,"-lpthread")
192     fi
193
194     if test "x$enable_djvu" = "xyes"; then
195         AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
196     else
197         AC_MSG_WARN([   
198 ** Djvu support is disabled since recent version of djvulibre 
199 ** library was not found. To get proper djvu support you need to
200 ** install development version of djvulibre. You can get it from
201 ** anonymous CVS server on djvulibre.sf.net. Just use something
202 ** like:
203
204 ** cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/djvu co djvulibre-3.5
205 ])
206     fi 
207 fi
208
209 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
210
211 dnl ================== End of djvu checks ===================================================
212
213 dnl ================== dvi checks ===================================================
214
215 AC_ARG_ENABLE(dvi,
216             [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=no)
217
218 AC_ARG_ENABLE(t1lib,
219             [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
220
221 if test "x$enable_dvi" = "xyes"; then
222     AC_C_CONST
223     AC_C_INLINE
224     AC_TYPE_SIZE_T
225     AC_CHECK_SIZEOF(long, 4)
226     AC_CHECK_SIZEOF(int, 4)
227     AC_CHECK_SIZEOF(short, 2)
228     AC_CHECK_SIZEOF(void *, 4)
229     AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
230
231     if test "x$enable_dvi" = "xyes"; then
232         AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
233     else
234         AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
235     fi
236 fi
237 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
238
239 if test "x$enable_dvi" = "xyes"; then
240     if test "x$enable_type1_fonts" = "xyes"; then
241         AC_CHECK_LIB([t1lib],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no)
242     fi
243
244     if test "x$enable_type1_fonts" = xyes; then
245         AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
246     fi
247 else 
248     enable_type1_fonts=no
249 fi
250 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
251
252 dnl ================== End of dvi checks ===================================================
253
254 dnl =================== Mime types list ====================================================
255
256 EVINCE_MIME_TYPES="application/pdf;application/postscript;application/x-gzpostscript"
257
258 if test "x$enable_dvi" = "xyes"; then
259         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-dvi"
260 fi
261 if test "x$enable_djvu" = "xyes"; then
262         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/vnd.djvu"
263 fi
264 if test "x$enable_tiff" = "xyes"; then
265         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/tiff"
266 fi
267 AC_SUBST(EVINCE_MIME_TYPES)
268
269 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
270 dnl stolen from nautilus and gnome-common
271
272 AC_ARG_ENABLE(more-warnings,
273 [  --enable-more-warnings  Maximum compiler warnings],
274 set_more_warnings="$enableval",[
275 if test -f $srcdir/autogen.sh; then
276         is_cvs_version=true
277         set_more_warnings=yes
278 else
279         set_more_warnings=no
280 fi
281 ])
282 AC_MSG_CHECKING(for more warnings, including -Werror)
283 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
284         AC_MSG_RESULT([yes, using gcc])
285         CFLAGS="\
286         -Wall \
287         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
288         -Wnested-externs -Wpointer-arith \
289         -Wcast-align -Wsign-compare \
290         -Werror \
291         $CFLAGS"
292
293 dnl     case " $CFLAGS " in
294 dnl         *[\ \       ]-ansi[\ \      ]*) ;;
295 dnl         *) CFLAGS="$CFLAGS -ansi" ;;
296 dnl     esac
297 dnl     case " $CFLAGS " in
298 dnl         *[\ \       ]-pedantic[\ \  ]*) ;;
299 dnl         *) CFLAGS="$CFLAGS -pedantic" ;;
300 dnl     esac
301
302         for option in -Wno-strict-aliasing -Wno-sign-compare; do
303                 SAVE_CFLAGS="$CFLAGS"
304                 CFLAGS="$CFLAGS $option"
305                 AC_MSG_CHECKING([whether gcc understands $option])
306                 AC_TRY_COMPILE([], [],
307                         has_option=yes,
308                         has_option=no,)
309                 if test $has_option = no; then
310                         CFLAGS="$SAVE_CFLAGS"
311                 fi
312                 AC_MSG_RESULT($has_option)
313                 unset has_option
314                 unset SAVE_CFLAGS
315         done
316         unset option
317 else
318         AC_MSG_RESULT(no)
319 fi
320
321 AC_OUTPUT([
322 Makefile
323 cut-n-paste/Makefile
324 cut-n-paste/recent-files/Makefile
325 cut-n-paste/zoom-control/Makefile
326 cut-n-paste/toolbar-editor/Makefile
327 data/Makefile
328 data/evince.desktop.in
329 lib/Makefile
330 pdf/Makefile
331 pixbuf/Makefile
332 tiff/Makefile
333 ps/Makefile
334 djvu/Makefile
335 dvi/Makefile
336 dvi/mdvi-lib/Makefile
337 po/Makefile.in
338 backend/Makefile
339 properties/Makefile
340 shell/Makefile
341 thumbnailer/Makefile
342 help/Makefile
343 help/C/Makefile
344 ])