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