]> www.fi.muni.cz Git - evince.git/blob - configure.ac
Fix to poppler requirement
[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.2.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 fi fr 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.0
34
35 PKG_CHECK_MODULES(LIBEVPRIVATE, gtk+-2.0 >= 2.4.0)
36 PKG_CHECK_MODULES(RECENT_FILES, gtk+-2.0 >= 2.4.0 libgnomeui-2.0 >= 2.4.0)
37 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)
38 PKG_CHECK_MODULES(THUMBNAILER, gtk+-2.0 >= 2.6.0 gnome-vfs-2.0 poppler-glib >= $POPPLER_REQUIRED)
39 PKG_CHECK_MODULES(DVI, gtk+-2.0 >= 2.6.0)
40 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0)
41 PKG_CHECK_MODULES(PS, gtk+-2.0 >= 2.6.0 gnome-vfs-2.0 libgnomeui-2.0)
42 PKG_CHECK_MODULES(POPPLER_GLIB, poppler-glib >= $POPPLER_REQUIRED)
43
44 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
45 AC_SUBST(GLIB_GENMARSHAL)
46
47 dnl Compile with disable-deprecated switches
48
49 AC_ARG_ENABLE(deprecated,
50 AC_HELP_STRING([--disable-deprecated],
51                [Don't allow any deprecated GTK+/etc. features.]),
52 set_enable_deprecated="$enableval",[
53 if test -f $srcdir/autogen.sh; then
54         is_cvs_version=true
55         set_enable_deprecated=no
56 else
57         set_enable_deprecated=yes
58         fi
59 ])
60 AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features])
61 if test "$set_enable_deprecated" != "yes"; then
62         AC_MSG_RESULT(yes)
63         EVINCE_DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
64 else
65         AC_MSG_RESULT(no)
66         EVINCE_DISABLE_DEPRECATED=""
67 fi
68 AC_SUBST(EVINCE_DISABLE_DEPRECATED)
69
70 AM_GCONF_SOURCE_2
71
72 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
73 if test "x$GCONFTOOL" = "xno"; then
74         AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
75 fi
76
77 dnl ================== ggv checks ===================================================
78 AC_ARG_WITH(gs-pkg,
79             [  --with-gs=dir       Directory Where GhostScript package is installed.])
80
81 if test "x$with_gs" = "x"; then
82         AC_PATH_PROG(GS_PROG, gs)
83         if test -z "$GS_PROG"; then
84                 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)
85         fi
86 else
87         GS_PROG=$with_gs
88 fi
89
90 AC_DEFINE_UNQUOTED(GS_PATH, "$GS_PROG", [Path to the 'gs' executable.])
91
92
93 dnl check for GS version
94 AC_MSG_CHECKING(for Ghostscript version...)
95 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
96 AC_MSG_RESULT(found $GS_VERSION)
97 if test "$GS_VERSION" -lt "7"; then
98         AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
99 fi
100 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS"
101 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
102 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
103 dnl ======================== End of ggv checks =================================
104
105 dnl ================== djvu checks ===================================================
106
107 AC_ARG_ENABLE(djvu,
108             [AC_HELP_STRING([--enable-djvu], [Compile with support of djvu viewer])],enable_djvu=yes,enable_djvu=no)
109
110 if test "x$enable_djvu" = "xyes"; then
111     AC_CHECK_HEADERS([libdjvu/ddjvuapi.h],enable_djvu=yes,enable_djvu=no,)
112 fi
113
114 if test "x$enable_djvu" = "xyes"; then
115     AC_CHECK_LIB([djvulibre],ddjvu_context_create,enable_djvu=yes,enable_djvu=no,"-lpthread")
116 fi
117
118 if test "x$enable_djvu" = "xyes"; then
119     AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
120 fi
121 AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)
122
123 dnl ================== End of djvu checks ===================================================
124
125 dnl ================== dvi checks ===================================================
126
127 AC_ARG_ENABLE(dvi,
128             [AC_HELP_STRING([--enable-dvi], [Compile with support of dvi viewer])],enable_dvi=yes,enable_dvi=no)
129
130 AC_ARG_ENABLE(t1lib,
131             [AC_HELP_STRING([--enable-t1lib], [Compile with support of t1lib for type1 fonts in dvi])],enable_type1_fonts=yes,enable_type1_fonts=no)
132
133 if test "x$enable_dvi" = "xyes"; then
134     AC_C_CONST
135     AC_C_INLINE
136     AC_TYPE_SIZE_T
137     AC_CHECK_SIZEOF(long, 4)
138     AC_CHECK_SIZEOF(int, 4)
139     AC_CHECK_SIZEOF(short, 2)
140     AC_CHECK_SIZEOF(void *, 4)
141     AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])
142
143     if test "x$enable_dvi" = "xyes"; then
144         AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
145     fi
146 fi
147 AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)
148
149 if test "x$enable_dvi" = "xyes"; then
150     if test "x$enable_type1_fonts" = "xyes"; then
151         AC_CHECK_LIB([t1lib],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no)
152     fi
153
154     if test "x$enable_type1_fonts" = xyes; then
155         AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
156     fi
157 else 
158     enable_type1_fonts=no
159 fi
160 AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)
161
162
163 dnl ================== End of dvi checks ===================================================
164
165 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
166 dnl stolen from nautilus and gnome-common
167
168 AC_ARG_ENABLE(more-warnings,
169 [  --enable-more-warnings  Maximum compiler warnings],
170 set_more_warnings="$enableval",[
171 if test -f $srcdir/autogen.sh; then
172         is_cvs_version=true
173         set_more_warnings=yes
174 else
175         set_more_warnings=no
176 fi
177 ])
178 AC_MSG_CHECKING(for more warnings, including -Werror)
179 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
180         AC_MSG_RESULT([yes, using gcc])
181         CFLAGS="\
182         -Wall \
183         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
184         -Wnested-externs -Wpointer-arith \
185         -Wcast-align -Wsign-compare \
186         -Werror \
187         $CFLAGS"
188
189 dnl     case " $CFLAGS " in
190 dnl         *[\ \       ]-ansi[\ \      ]*) ;;
191 dnl         *) CFLAGS="$CFLAGS -ansi" ;;
192 dnl     esac
193 dnl     case " $CFLAGS " in
194 dnl         *[\ \       ]-pedantic[\ \  ]*) ;;
195 dnl         *) CFLAGS="$CFLAGS -pedantic" ;;
196 dnl     esac
197
198         for option in -Wno-strict-aliasing -Wno-sign-compare; do
199                 SAVE_CFLAGS="$CFLAGS"
200                 CFLAGS="$CFLAGS $option"
201                 AC_MSG_CHECKING([whether gcc understands $option])
202                 AC_TRY_COMPILE([], [],
203                         has_option=yes,
204                         has_option=no,)
205                 if test $has_option = no; then
206                         CFLAGS="$SAVE_CFLAGS"
207                 fi
208                 AC_MSG_RESULT($has_option)
209                 unset has_option
210                 unset SAVE_CFLAGS
211         done
212         unset option
213 else
214         AC_MSG_RESULT(no)
215 fi
216
217
218 AC_OUTPUT([
219 Makefile
220 cut-n-paste/Makefile
221 cut-n-paste/recent-files/Makefile
222 data/Makefile
223 lib/Makefile
224 pdf/Makefile
225 pixbuf/Makefile
226 ps/Makefile
227 djvu/Makefile
228 dvi/Makefile
229 dvi/mdvi-lib/Makefile
230 po/Makefile.in
231 backend/Makefile
232 shell/Makefile
233 thumbnailer/Makefile
234 help/Makefile
235 help/C/Makefile
236 ])