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