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