]> www.fi.muni.cz Git - evince.git/blob - configure.ac
Added hu to ALL_LINGUAS.
[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 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_WITH(libtiff,
109             [AC_HELP_STRING([--without-libtiff],
110                             [disable TIFF loader for gdk-pixbuf])])
111
112 dnl Test for libtiff
113   if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
114     AC_CHECK_LIB(tiff, TIFFReadScanline,
115       [AC_CHECK_HEADER(tiffio.h,
116         TIFF='tiff'; LIBTIFF='-ltiff',
117         AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
118       [AC_CHECK_LIB(tiff, TIFFWriteScanline,
119         [AC_CHECK_HEADER(tiffio.h,
120           TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
121           AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
122         [AC_CHECK_LIB(tiff34, TIFFFlushData,
123           [AC_CHECK_HEADER(tiffio.h,
124             TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
125             AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
126         AC_MSG_WARN(*** TIFF loader will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
127   fi
128
129   if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
130      AC_MSG_ERROR([
131 *** Checks for TIFF loader failed. You can build without it by passing 
132 *** --without-libtiff to configure ])
133   fi
134 AC_SUBST(LIBTIFF)
135 dnl ================== end of tiff checks ============================================
136
137 dnl ================== djvu checks ===================================================
138
139 AC_ARG_ENABLE(djvu,
140             [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu="$enableval",enable_djvu=no)
141
142 if test "x$enable_djvu" = "xyes"; then
143     AC_CHECK_HEADERS([libdjvu/ddjvuapi.h],enable_djvu=yes,enable_djvu=no,)
144 fi
145
146 if test "x$enable_djvu" = "xyes"; then
147     AC_CHECK_LIB([djvulibre],ddjvu_context_create,enable_djvu=yes,enable_djvu=no,"-lpthread")
148 fi
149
150 if test "x$enable_djvu" = "xyes"; then
151     AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
152 fi
153 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
154
155 dnl ================== End of djvu checks ===================================================
156
157 dnl ================== dvi checks ===================================================
158
159 AC_ARG_ENABLE(dvi,
160             [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi="$enableval",enable_dvi=no)
161
162 AC_ARG_ENABLE(t1lib,
163             [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts="$enableval",enable_type1_fonts=no)
164
165 if test "x$enable_dvi" = "xyes"; then
166     AC_C_CONST
167     AC_C_INLINE
168     AC_TYPE_SIZE_T
169     AC_CHECK_SIZEOF(long, 4)
170     AC_CHECK_SIZEOF(int, 4)
171     AC_CHECK_SIZEOF(short, 2)
172     AC_CHECK_SIZEOF(void *, 4)
173     AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
174
175     if test "x$enable_dvi" = "xyes"; then
176         AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
177     fi
178 fi
179 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
180
181 if test "x$enable_dvi" = "xyes"; then
182     if test "x$enable_type1_fonts" = "xyes"; then
183         AC_CHECK_LIB([t1lib],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no)
184     fi
185
186     if test "x$enable_type1_fonts" = xyes; then
187         AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
188     fi
189 else 
190     enable_type1_fonts=no
191 fi
192 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
193
194
195 dnl ================== End of dvi checks ===================================================
196
197 dnl =================== Mime types list ====================================================
198
199 EVINCE_MIME_TYPES="application/pdf;application/postscript;application/x-gzpostscript"
200
201 if test "x$enable_dvi" = "xyes"; then
202         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-dvi"
203 fi
204 if test "x$enable_djvu" = "xyes"; then
205         EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;image/vnd.djvu"
206 fi
207 AC_SUBST(EVINCE_MIME_TYPES)
208
209 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
210 dnl stolen from nautilus and gnome-common
211
212 AC_ARG_ENABLE(more-warnings,
213 [  --enable-more-warnings  Maximum compiler warnings],
214 set_more_warnings="$enableval",[
215 if test -f $srcdir/autogen.sh; then
216         is_cvs_version=true
217         set_more_warnings=yes
218 else
219         set_more_warnings=no
220 fi
221 ])
222 AC_MSG_CHECKING(for more warnings, including -Werror)
223 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
224         AC_MSG_RESULT([yes, using gcc])
225         CFLAGS="\
226         -Wall \
227         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
228         -Wnested-externs -Wpointer-arith \
229         -Wcast-align -Wsign-compare \
230         -Werror \
231         $CFLAGS"
232
233 dnl     case " $CFLAGS " in
234 dnl         *[\ \       ]-ansi[\ \      ]*) ;;
235 dnl         *) CFLAGS="$CFLAGS -ansi" ;;
236 dnl     esac
237 dnl     case " $CFLAGS " in
238 dnl         *[\ \       ]-pedantic[\ \  ]*) ;;
239 dnl         *) CFLAGS="$CFLAGS -pedantic" ;;
240 dnl     esac
241
242         for option in -Wno-strict-aliasing -Wno-sign-compare; do
243                 SAVE_CFLAGS="$CFLAGS"
244                 CFLAGS="$CFLAGS $option"
245                 AC_MSG_CHECKING([whether gcc understands $option])
246                 AC_TRY_COMPILE([], [],
247                         has_option=yes,
248                         has_option=no,)
249                 if test $has_option = no; then
250                         CFLAGS="$SAVE_CFLAGS"
251                 fi
252                 AC_MSG_RESULT($has_option)
253                 unset has_option
254                 unset SAVE_CFLAGS
255         done
256         unset option
257 else
258         AC_MSG_RESULT(no)
259 fi
260
261 AC_OUTPUT([
262 Makefile
263 cut-n-paste/Makefile
264 cut-n-paste/recent-files/Makefile
265 cut-n-paste/zoom-control/Makefile
266 cut-n-paste/toolbar-editor/Makefile
267 data/Makefile
268 data/evince.desktop.in
269 lib/Makefile
270 pdf/Makefile
271 pixbuf/Makefile
272 tiff/Makefile
273 ps/Makefile
274 djvu/Makefile
275 dvi/Makefile
276 dvi/mdvi-lib/Makefile
277 po/Makefile.in
278 backend/Makefile
279 shell/Makefile
280 thumbnailer/Makefile
281 help/Makefile
282 help/C/Makefile
283 ])