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