]> www.fi.muni.cz Git - evince.git/blob - configure.ac
Fixed German translation by Jens Seidel <jensseidel@users.sf.net>.
[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 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(DVI, gtk+-2.0 >= 2.6.0)
45 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0)
46 PKG_CHECK_MODULES(PS, gtk+-2.0 >= 2.6.0 gnome-vfs-2.0 libgnomeui-2.0)
47 PKG_CHECK_MODULES(POPPLER_GLIB, poppler-glib >= $POPPLER_REQUIRED)
48
49 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
50 AC_SUBST(GLIB_GENMARSHAL)
51
52 AC_ARG_ENABLE([dbus],
53         AS_HELP_STRING([--enable-dbus],[Enable DBUS (default=no)]),
54         [enable_dbus=$enableval],
55         [enable_dbus=no])
56
57 AC_MSG_RESULT([$enable_dbus])
58
59 if test "x$enable_dbus" = "xyes" ; then
60         AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
61          AC_DEFINE([ENABLE_METADATA],[1],[Define if metadata support is enabled])
62         PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED])
63 fi
64
65 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
66 AM_CONDITIONAL([ENABLE_METADATA], [test "x$enable_dbus" = "xyes"])
67
68 dnl Compile with disable-deprecated switches
69
70 AC_ARG_ENABLE(deprecated,
71 AC_HELP_STRING([--disable-deprecated],
72                [Don't allow any deprecated GTK+/etc. features.]),
73 set_enable_deprecated="$enableval",[
74 if test -f $srcdir/autogen.sh; then
75         is_cvs_version=true
76         set_enable_deprecated=no
77 else
78         set_enable_deprecated=yes
79         fi
80 ])
81 AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features])
82 if test "$set_enable_deprecated" != "yes"; then
83         AC_MSG_RESULT(yes)
84         EVINCE_DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
85 else
86         AC_MSG_RESULT(no)
87         EVINCE_DISABLE_DEPRECATED=""
88 fi
89 AC_SUBST(EVINCE_DISABLE_DEPRECATED)
90
91 evince_save_LIBS=$LIBS
92 LIBS="$LIBS $GTK_LIBS"
93 AC_CHECK_FUNCS(gtk_icon_view_get_visible_range)
94 LIBS=$evince_save_LIBS
95
96 AM_GCONF_SOURCE_2
97
98 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
99 if test "x$GCONFTOOL" = "xno"; then
100         AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
101 fi
102
103 dnl ================== ggv checks ===================================================
104 AC_ARG_WITH(gs-pkg,
105             [  --with-gs=dir       Directory Where GhostScript package is installed.])
106
107 if test "x$with_gs" = "x"; then
108         AC_PATH_PROG(GS_PROG, gs)
109         if test -z "$GS_PROG"; then
110                 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)
111         fi
112 else
113         GS_PROG=$with_gs
114 fi
115
116 AC_DEFINE_UNQUOTED(GS_PATH, "$GS_PROG", [Path to the 'gs' executable.])
117
118
119 dnl check for GS version
120 AC_MSG_CHECKING(for Ghostscript version...)
121 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
122 AC_MSG_RESULT(found $GS_VERSION)
123 if test "$GS_VERSION" -lt "7"; then
124         AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
125 fi
126 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS"
127 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
128 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
129 dnl ======================== End of ggv checks =================================
130
131 dnl ================== tiff checks ===================================================
132 AC_ARG_ENABLE(tiff,
133             [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
134
135 if test "x$enable_tiff" = "xyes"; then
136     AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
137     if test "x$enable_tiff" = "xyes"; then
138         AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
139         AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
140     fi
141     if test "x$enable_tiff" = "xyes"; then
142             AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
143     else
144             AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
145     fi 
146 fi
147
148 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
149 dnl ================== end of tiff checks ============================================
150
151 dnl ================== djvu checks ===================================================
152
153 AC_ARG_ENABLE(djvu,
154             [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=no)
155
156 if test "x$enable_djvu" = "xyes"; then
157     AC_CHECK_HEADERS([libdjvu/ddjvuapi.h],enable_djvu=yes,enable_djvu=no,)
158
159     if test "x$enable_djvu" = "xyes"; then
160         AC_CHECK_LIB([djvulibre],ddjvu_context_create,enable_djvu=yes,enable_djvu=no,"-lpthread")
161         AC_CHECK_LIB([djvulibre],ddjvu_document_get_pageinfo,enable_djvu=yes,enable_djvu=no,"-lpthread")
162     fi
163
164     if test "x$enable_djvu" = "xyes"; then
165         AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
166     else
167         AC_MSG_WARN([   
168 ** Djvu support is disabled since recent version of djvulibre 
169 ** library was not found. To get proper djvu support you need to
170 ** install development version of djvulibre. You can get it from
171 ** anonymous CVS server on djvulibre.sf.net. Just use something
172 ** like:
173
174 ** cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/djvu co djvulibre-3.5
175 ])
176     fi 
177 fi
178
179 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
180
181 dnl ================== End of djvu checks ===================================================
182
183 dnl ================== dvi checks ===================================================
184
185 AC_ARG_ENABLE(dvi,
186             [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=no)
187
188 AC_ARG_ENABLE(t1lib,
189             [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
190
191 if test "x$enable_dvi" = "xyes"; then
192     AC_C_CONST
193     AC_C_INLINE
194     AC_TYPE_SIZE_T
195     AC_CHECK_SIZEOF(long, 4)
196     AC_CHECK_SIZEOF(int, 4)
197     AC_CHECK_SIZEOF(short, 2)
198     AC_CHECK_SIZEOF(void *, 4)
199     AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
200
201     if test "x$enable_dvi" = "xyes"; then
202         AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
203     else
204         AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
205     fi
206 fi
207 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
208
209 if test "x$enable_dvi" = "xyes"; then
210     if test "x$enable_type1_fonts" = "xyes"; then
211         AC_CHECK_LIB([t1lib],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no)
212     fi
213
214     if test "x$enable_type1_fonts" = xyes; then
215         AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
216     fi
217 else 
218     enable_type1_fonts=no
219 fi
220 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
221
222 dnl ================== End of dvi checks ===================================================
223
224 dnl =================== Mime types list ====================================================
225
226 EVINCE_MIME_TYPES="application/pdf;application/postscript;application/x-gzpostscript"
227
228 if test "x$enable_dvi" = "xyes"; then
229         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-dvi"
230 fi
231 if test "x$enable_djvu" = "xyes"; then
232         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/vnd.djvu"
233 fi
234 if test "x$enable_tiff" = "xyes"; then
235         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/tiff"
236 fi
237 AC_SUBST(EVINCE_MIME_TYPES)
238
239 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
240 dnl stolen from nautilus and gnome-common
241
242 AC_ARG_ENABLE(more-warnings,
243 [  --enable-more-warnings  Maximum compiler warnings],
244 set_more_warnings="$enableval",[
245 if test -f $srcdir/autogen.sh; then
246         is_cvs_version=true
247         set_more_warnings=yes
248 else
249         set_more_warnings=no
250 fi
251 ])
252 AC_MSG_CHECKING(for more warnings, including -Werror)
253 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
254         AC_MSG_RESULT([yes, using gcc])
255         CFLAGS="\
256         -Wall \
257         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
258         -Wnested-externs -Wpointer-arith \
259         -Wcast-align -Wsign-compare \
260         -Werror \
261         $CFLAGS"
262
263 dnl     case " $CFLAGS " in
264 dnl         *[\ \       ]-ansi[\ \      ]*) ;;
265 dnl         *) CFLAGS="$CFLAGS -ansi" ;;
266 dnl     esac
267 dnl     case " $CFLAGS " in
268 dnl         *[\ \       ]-pedantic[\ \  ]*) ;;
269 dnl         *) CFLAGS="$CFLAGS -pedantic" ;;
270 dnl     esac
271
272         for option in -Wno-strict-aliasing -Wno-sign-compare; do
273                 SAVE_CFLAGS="$CFLAGS"
274                 CFLAGS="$CFLAGS $option"
275                 AC_MSG_CHECKING([whether gcc understands $option])
276                 AC_TRY_COMPILE([], [],
277                         has_option=yes,
278                         has_option=no,)
279                 if test $has_option = no; then
280                         CFLAGS="$SAVE_CFLAGS"
281                 fi
282                 AC_MSG_RESULT($has_option)
283                 unset has_option
284                 unset SAVE_CFLAGS
285         done
286         unset option
287 else
288         AC_MSG_RESULT(no)
289 fi
290
291 AC_OUTPUT([
292 Makefile
293 cut-n-paste/Makefile
294 cut-n-paste/recent-files/Makefile
295 cut-n-paste/zoom-control/Makefile
296 cut-n-paste/toolbar-editor/Makefile
297 data/Makefile
298 data/evince.desktop.in
299 lib/Makefile
300 pdf/Makefile
301 pixbuf/Makefile
302 tiff/Makefile
303 ps/Makefile
304 djvu/Makefile
305 dvi/Makefile
306 dvi/mdvi-lib/Makefile
307 po/Makefile.in
308 backend/Makefile
309 properties/Makefile
310 shell/Makefile
311 thumbnailer/Makefile
312 help/Makefile
313 help/C/Makefile
314 ])