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