]> www.fi.muni.cz Git - evince.git/blob - configure.ac
Cleanup tiff configure checks. Fix for bug 305218.
[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 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 AM_GCONF_SOURCE_2
73
74 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
75 if test "x$GCONFTOOL" = "xno"; then
76         AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
77 fi
78
79 dnl ================== ggv checks ===================================================
80 AC_ARG_WITH(gs-pkg,
81             [  --with-gs=dir       Directory Where GhostScript package is installed.])
82
83 if test "x$with_gs" = "x"; then
84         AC_PATH_PROG(GS_PROG, gs)
85         if test -z "$GS_PROG"; then
86                 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)
87         fi
88 else
89         GS_PROG=$with_gs
90 fi
91
92 AC_DEFINE_UNQUOTED(GS_PATH, "$GS_PROG", [Path to the 'gs' executable.])
93
94
95 dnl check for GS version
96 AC_MSG_CHECKING(for Ghostscript version...)
97 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
98 AC_MSG_RESULT(found $GS_VERSION)
99 if test "$GS_VERSION" -lt "7"; then
100         AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
101 fi
102 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS"
103 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
104 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
105 dnl ======================== End of ggv checks =================================
106
107 dnl ================== tiff checks ===================================================
108 AC_ARG_ENABLE(tiff,
109             [AC_HELP_STRING([--enable-tiff], [Compile with support of multipage tiff])],enable_tiff="$enableval",enable_tiff=yes)
110
111 if test "x$enable_tiff" = "xyes"; then
112     AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
113     if test "x$enable_tiff" = "xyes"; then
114         AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
115         AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
116     fi
117     if test "x$enable_tiff" = "xyes"; then
118             AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
119     else
120             AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
121     fi 
122 fi
123
124 AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
125 dnl ================== end of tiff checks ============================================
126
127 dnl ================== djvu checks ===================================================
128
129 AC_ARG_ENABLE(djvu,
130             [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=no)
131
132 if test "x$enable_djvu" = "xyes"; then
133     AC_CHECK_HEADERS([libdjvu/ddjvuapi.h],enable_djvu=yes,enable_djvu=no,)
134     if test "x$enable_djvu" = "xyes"; then
135         AC_CHECK_LIB([djvulibre],ddjvu_context_create,enable_djvu=yes,enable_djvu=no,"-lpthread")
136     fi
137
138     if test "x$enable_djvu" = "xyes"; then
139         AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
140     else
141         AC_MSG_WARN("Djvu support is disabled since djvulibre library version 3.5.14 or newer is not found")
142     fi 
143 fi
144
145 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
146
147 dnl ================== End of djvu checks ===================================================
148
149 dnl ================== dvi checks ===================================================
150
151 AC_ARG_ENABLE(dvi,
152             [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=no)
153
154 AC_ARG_ENABLE(t1lib,
155             [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
156
157 if test "x$enable_dvi" = "xyes"; then
158     AC_C_CONST
159     AC_C_INLINE
160     AC_TYPE_SIZE_T
161     AC_CHECK_SIZEOF(long, 4)
162     AC_CHECK_SIZEOF(int, 4)
163     AC_CHECK_SIZEOF(short, 2)
164     AC_CHECK_SIZEOF(void *, 4)
165     AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
166
167     if test "x$enable_dvi" = "xyes"; then
168         AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
169     else
170         AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
171     fi
172 fi
173 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
174
175 if test "x$enable_dvi" = "xyes"; then
176     if test "x$enable_type1_fonts" = "xyes"; then
177         AC_CHECK_LIB([t1lib],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no)
178     fi
179
180     if test "x$enable_type1_fonts" = xyes; then
181         AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
182     fi
183 else 
184     enable_type1_fonts=no
185 fi
186 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
187
188 dnl ================== End of dvi checks ===================================================
189
190 dnl =================== Mime types list ====================================================
191
192 EVINCE_MIME_TYPES="application/pdf;application/postscript;application/x-gzpostscript"
193
194 if test "x$enable_dvi" = "xyes"; then
195         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-dvi"
196 fi
197 if test "x$enable_djvu" = "xyes"; then
198         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/vnd.djvu"
199 fi
200 if test "x$enable_tiff" = "xyes"; then
201         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/tiff"
202 fi
203 AC_SUBST(EVINCE_MIME_TYPES)
204
205 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
206 dnl stolen from nautilus and gnome-common
207
208 AC_ARG_ENABLE(more-warnings,
209 [  --enable-more-warnings  Maximum compiler warnings],
210 set_more_warnings="$enableval",[
211 if test -f $srcdir/autogen.sh; then
212         is_cvs_version=true
213         set_more_warnings=yes
214 else
215         set_more_warnings=no
216 fi
217 ])
218 AC_MSG_CHECKING(for more warnings, including -Werror)
219 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
220         AC_MSG_RESULT([yes, using gcc])
221         CFLAGS="\
222         -Wall \
223         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
224         -Wnested-externs -Wpointer-arith \
225         -Wcast-align -Wsign-compare \
226         -Werror \
227         $CFLAGS"
228
229 dnl     case " $CFLAGS " in
230 dnl         *[\ \       ]-ansi[\ \      ]*) ;;
231 dnl         *) CFLAGS="$CFLAGS -ansi" ;;
232 dnl     esac
233 dnl     case " $CFLAGS " in
234 dnl         *[\ \       ]-pedantic[\ \  ]*) ;;
235 dnl         *) CFLAGS="$CFLAGS -pedantic" ;;
236 dnl     esac
237
238         for option in -Wno-strict-aliasing -Wno-sign-compare; do
239                 SAVE_CFLAGS="$CFLAGS"
240                 CFLAGS="$CFLAGS $option"
241                 AC_MSG_CHECKING([whether gcc understands $option])
242                 AC_TRY_COMPILE([], [],
243                         has_option=yes,
244                         has_option=no,)
245                 if test $has_option = no; then
246                         CFLAGS="$SAVE_CFLAGS"
247                 fi
248                 AC_MSG_RESULT($has_option)
249                 unset has_option
250                 unset SAVE_CFLAGS
251         done
252         unset option
253 else
254         AC_MSG_RESULT(no)
255 fi
256
257 AC_OUTPUT([
258 Makefile
259 cut-n-paste/Makefile
260 cut-n-paste/recent-files/Makefile
261 cut-n-paste/zoom-control/Makefile
262 cut-n-paste/toolbar-editor/Makefile
263 data/Makefile
264 data/evince.desktop.in
265 lib/Makefile
266 pdf/Makefile
267 pixbuf/Makefile
268 tiff/Makefile
269 ps/Makefile
270 djvu/Makefile
271 dvi/Makefile
272 dvi/mdvi-lib/Makefile
273 po/Makefile.in
274 backend/Makefile
275 shell/Makefile
276 thumbnailer/Makefile
277 help/Makefile
278 help/C/Makefile
279 ])