]> www.fi.muni.cz Git - evince.git/blob - configure.ac
Hungarian translation updated.
[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 AM_CONFIG_HEADER(config.h)
8
9 AM_MAINTAINER_MODE
10
11 AM_PROG_LIBTOOL
12
13 AC_ISC_POSIX
14 AC_PROG_CC
15 AM_PROG_CC_STDC
16 AC_PROG_CXX
17 AC_STDC_HEADERS
18 AC_PROG_INTLTOOL
19 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
20 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
21
22 GNOME_COMMON_INIT
23 GNOME_MAINTAINER_MODE_DEFINES
24 GNOME_COMPILE_WARNINGS
25 GNOME_CXX_WARNINGS
26 GNOME_DEBUG_CHECK
27
28 ALL_LINGUAS="bg ca cs da de el en_CA en_GB es eu fi fr hu ja ko lt nb nl no pt_BR ru rw sk sv th uk wa zh_CN zh_TW"
29
30 AM_GLIB_GNU_GETTEXT
31
32 GETTEXT_PACKAGE=AC_PACKAGE_NAME
33 AC_SUBST(GETTEXT_PACKAGE)
34 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
35
36 dnl Check dependencies
37
38 # LIB_CFLAGS       for helpers and generic widgets. (lib, cut-and-paste)
39 # BACKEND_CFLAGS   for backend implementations.
40 # FRONTEND_CFLAGS  for frontend implementations. (properties, thumbnailer)
41 # FRONTEND_LIBS
42 # SHELL_CFLAGS     for shell implementation.
43 # SHELL_LIBS
44
45 POPPLER_REQUIRED=0.3.3
46 DBUS_GLIB_REQUIRED=0.33
47 GTK_REQUIRED=2.6.0
48 LIBGNOMEUI_REQUIRED=2.6.0
49
50 PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
51 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED)
52 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libglade-2.0 poppler-glib >= $POPPLER_REQUIRED)
53 PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED)
54 PKG_CHECK_MODULES(SHELL_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gnome-vfs-2.0 libgnomeprint-2.2 >= 2.5.1 libgnomeprintui-2.2 libglade-2.0 gconf-2.0 poppler-glib >= $POPPLER_REQUIRED)
55
56 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
57 AC_SUBST(GLIB_GENMARSHAL)
58
59 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
60         [enable_dbus=yes],[enable_dbus=no])
61 AC_SUBST([DBUS_CFLAGS])
62 AC_SUBST([DBUS_LIBS])
63
64 if test "x$enable_dbus" = "xno"; then
65         AC_MSG_WARN([DBUS support is disabled since dbus $DBUS_GLIB_REQUIRED or higher was not found])
66 fi
67
68 if test "x$enable_dbus" = "xyes" ; then
69         AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
70
71         if test x$DBUS_BINDING_TOOL = "xno" ; then
72                 AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
73         fi                                            
74
75         AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
76
77         DBUS_VERSION=`$PKG_CONFIG --modversion dbus-glib-1 | sed 's/0.\([[0-9]]*\)/\1/'`
78         AC_DEFINE_UNQUOTED(DBUS_VERSION, $DBUS_VERSION, [DBUS version.])
79 fi
80
81 SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS"
82 SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS -ltiff -lz"
83 AC_SUBST(SHELL_CFLAGS)
84 AC_SUBST(SHELL_LIBS)
85
86 FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS"
87 FRONTEND_LIBS="$FRONTEND_CORE_LIBS -ltiff -lz"
88 AC_SUBST(FRONTEND_CFLAGS)
89 AC_SUBST(FRONTEND_LIBS)
90
91 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
92 AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
93
94 dnl Check for Nautilus property page build
95 AC_ARG_ENABLE(nautilus,
96         AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
97         [case "${enableval}" in
98         yes) ENABLE_NAUTILUS=yes ;;
99         no) ENABLE_NAUTILUS=no ;;
100         *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
101         esac],
102         [ENABLE_NAUTILUS=yes]) dnl Default value
103
104 if test x$ENABLE_NAUTILUS = "xyes" ; then
105         PKG_CHECK_MODULES(NAUTILUS, gtk+-x11-2.0 $MM gthread-2.0 libnautilus-extension,
106                         [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
107 fi
108
109 AC_SUBST(NAUTILUS_CFLAGS)
110 AC_SUBST(NAUTILUS_LIBS)
111 if test x$HAVE_NAUTILUS = "xyes"; then
112         AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
113 fi
114 AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
115
116 dnl Check for gtk_icon_view_get_visible_range
117 evince_save_LIBS=$LIBS
118 LIBS="$LIBS $FRONTEND_CORE_LIBS"
119 AC_CHECK_FUNCS(gtk_icon_view_get_visible_range)
120 LIBS=$evince_save_LIBS
121
122 dnl GConf configuration
123 AM_GCONF_SOURCE_2
124
125 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
126 if test "x$GCONFTOOL" = "xno"; then
127         AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
128 fi
129
130 dnl ================== ggv checks ===================================================
131 AC_ARG_WITH(gs-pkg,
132             [  --with-gs=dir       Directory Where GhostScript package is installed.])
133
134 if test "x$with_gs" = "x"; then
135         AC_PATH_PROG(GS_PROG, gs)
136         if test -z "$GS_PROG"; then
137                 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)
138         fi
139 else
140         GS_PROG=$with_gs
141 fi
142
143 AC_DEFINE_UNQUOTED(GS_PATH, "$GS_PROG", [Path to the 'gs' executable.])
144
145
146 dnl check for GS version
147 AC_MSG_CHECKING(for Ghostscript version...)
148 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
149 AC_MSG_RESULT(found $GS_VERSION)
150 if test "$GS_VERSION" -lt "7"; then
151         AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
152 fi
153 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS"
154 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
155 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
156 dnl ======================== End of ggv checks =================================
157
158 dnl ================== tiff checks ===================================================
159 AC_ARG_ENABLE(tiff,
160             [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
161
162 if test "x$enable_tiff" = "xyes"; then
163     AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
164     if test "x$enable_tiff" = "xyes"; then
165         AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
166         AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
167     fi
168     if test "x$enable_tiff" = "xyes"; then
169             AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
170     else
171             AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
172     fi 
173 fi
174
175 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
176 dnl ================== end of tiff checks ============================================
177
178 dnl ================== djvu checks ===================================================
179
180 AC_ARG_ENABLE(djvu,
181             [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=no)
182
183 if test "x$enable_djvu" = "xyes"; then
184     AC_CHECK_HEADERS([libdjvu/ddjvuapi.h],enable_djvu=yes,enable_djvu=no,)
185
186     if test "x$enable_djvu" = "xyes"; then
187         AC_CHECK_LIB([djvulibre],ddjvu_context_create,enable_djvu=yes,enable_djvu=no,"-lpthread")
188         AC_CHECK_LIB([djvulibre],ddjvu_document_get_pageinfo,enable_djvu=yes,enable_djvu=no,"-lpthread")
189     fi
190
191     if test "x$enable_djvu" = "xyes"; then
192         AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
193     else
194         AC_MSG_WARN([   
195 ** Djvu support is disabled since recent version of djvulibre 
196 ** library was not found. To get proper djvu support you need to
197 ** install development version of djvulibre. You can get it from
198 ** anonymous CVS server on djvulibre.sf.net. Just use something
199 ** like:
200
201 ** cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/djvu co djvulibre-3.5
202 ])
203     fi 
204 fi
205
206 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
207
208 dnl ================== End of djvu checks ===================================================
209
210 dnl ================== dvi checks ===================================================
211
212 AC_ARG_ENABLE(dvi,
213             [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=no)
214
215 AC_ARG_ENABLE(t1lib,
216             [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
217
218 if test "x$enable_dvi" = "xyes"; then
219     AC_C_CONST
220     AC_C_INLINE
221     AC_TYPE_SIZE_T
222     AC_CHECK_SIZEOF(long, 4)
223     AC_CHECK_SIZEOF(int, 4)
224     AC_CHECK_SIZEOF(short, 2)
225     AC_CHECK_SIZEOF(void *, 4)
226     AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
227
228     if test "x$enable_dvi" = "xyes"; then
229         AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
230     else
231         AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
232     fi
233 fi
234 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
235
236 if test "x$enable_dvi" = "xyes"; then
237     if test "x$enable_type1_fonts" = "xyes"; then
238         AC_CHECK_LIB([t1lib],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no)
239     fi
240
241     if test "x$enable_type1_fonts" = xyes; then
242         AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
243     fi
244 else 
245     enable_type1_fonts=no
246 fi
247 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
248
249 dnl ================== End of dvi checks ===================================================
250
251 dnl ================== pixbuf checks ===================================================
252
253 AC_ARG_ENABLE(pixbuf,
254             [AC_HELP_STRING([--enable-pixbuf], [Compile with support of pixbuf])],enable_pixbuf="$enableval",enable_pixbuf=no)
255 if test "x$enable_pixbuf" = "xyes"; then
256         AC_DEFINE([ENABLE_PIXBUF], [1], [Enable pixbuf support.])
257 fi
258 AM_CONDITIONAL(ENABLE_PIXBUF, test x$enable_pixbuf = xyes)
259
260 dnl ================== End of dvi checks ===================================================
261
262 dnl =================== Mime types list ====================================================
263
264 EVINCE_MIME_TYPES="application/pdf;application/postscript;application/x-gzpostscript"
265
266 if test "x$enable_dvi" = "xyes"; then
267         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-dvi"
268 fi
269 if test "x$enable_djvu" = "xyes"; then
270         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/vnd.djvu"
271 fi
272 if test "x$enable_tiff" = "xyes"; then
273         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/tiff"
274 fi
275 AC_SUBST(EVINCE_MIME_TYPES)
276
277 AC_CONFIG_FILES([
278 Makefile
279 cut-n-paste/Makefile
280 cut-n-paste/recent-files/Makefile
281 cut-n-paste/zoom-control/Makefile
282 cut-n-paste/toolbar-editor/Makefile
283 data/Makefile
284 data/evince.desktop.in
285 lib/Makefile
286 pdf/Makefile
287 pixbuf/Makefile
288 tiff/Makefile
289 ps/Makefile
290 djvu/Makefile
291 dvi/Makefile
292 dvi/mdvi-lib/Makefile
293 po/Makefile.in
294 backend/Makefile
295 properties/Makefile
296 shell/Makefile
297 thumbnailer/Makefile
298 help/Makefile
299 help/C/Makefile
300 ])
301
302 AC_OUTPUT