]> git.0d.be Git - empathy.git/blob - configure.ac
Use enchant instead of aspell. Fixes bug #460624 (Frederic Peters).
[empathy.git] / configure.ac
1 AC_INIT(Empathy, 0.23.2, http://bugzilla.gnome.org/browse.cgi?product=empathy)
2 AC_PREREQ(2.59)
3 AC_COPYRIGHT([
4   Copyright (C) 2003-2007 Imendio AB
5   Copyright (C) 2007 Collabora Ltd.
6 ])
7
8 # LT Version numbers, remember to change them just *before* a release.
9 #   (Interfaces removed:    CURRENT++, AGE=0, REVISION=0)
10 #   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
11 #   (No interfaces changed:                   REVISION++)
12 LIBEMPATHY_CURRENT=12
13 LIBEMPATHY_AGE=0
14 LIBEMPATHY_REVISION=0
15
16 LIBEMPATHY_GTK_CURRENT=12
17 LIBEMPATHY_GTK_AGE=0
18 LIBEMPATHY_GTK_REVISION=0
19
20 AC_SUBST(LIBEMPATHY_CURRENT)
21 AC_SUBST(LIBEMPATHY_AGE)
22 AC_SUBST(LIBEMPATHY_REVISION)
23 AC_SUBST(LIBEMPATHY_GTK_CURRENT)
24 AC_SUBST(LIBEMPATHY_GTK_AGE)
25 AC_SUBST(LIBEMPATHY_GTK_REVISION)
26
27 # Minimal version required
28 GLIB_REQUIRED=2.15.5
29 GTK_REQUIRED=2.12.0
30 GCONF_REQUIRED=1.2.0
31 LIBGLADE_REQUIRED=2.0.0
32 LIBPANELAPPLET_REQUIRED=2.10.0
33 TELEPATHY_GLIB_REQUIRED=0.7.3
34 MISSION_CONTROL_REQUIRED=4.61
35
36 # Uncomment that to build without deprecated symbols
37 # AC_DEFINE(GTK_DISABLE_DEPRECATED, 1, [Disable deprecated GTK symbols])
38 # AC_DEFINE(G_DISABLE_DEPRECATED, 1, [Disable deprecated GLib symbols])
39
40 AC_CONFIG_MACRO_DIR([m4])
41 AC_CONFIG_HEADERS([config.h])
42 AC_CONFIG_SRCDIR([configure.ac])
43 AC_CONFIG_AUX_DIR(.)
44
45 GNOME_COMMON_INIT
46
47 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define -Wno-portability)
48 AM_MAINTAINER_MODE
49 AC_ISC_POSIX
50 AC_PROG_CC
51 AC_HEADER_STDC
52 AM_PROG_LIBTOOL
53 AM_PROG_MKDIR_P
54 AM_PATH_GLIB_2_0
55 AC_PATH_XTRA
56 IT_PROG_INTLTOOL([0.35.0])
57 GTK_DOC_CHECK([1.3])
58 GNOME_DOC_INIT
59 IDT_COMPILE_WARNINGS
60 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
61 AC_PATH_PROG(GCONFTOOL, gconftool-2)
62 AM_GCONF_SOURCE_2
63 GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
64 AC_SUBST(GLIB_GENMARSHAL)
65
66 AC_CHECK_PROGS([XSLTPROC], [xsltproc])
67 if test -z "$XSLTPROC"; then
68   AC_MSG_ERROR([xsltproc (from libxslt) is required])
69 fi
70 AC_CHECK_PROGS([PYTHON], [python python2.3 python2.4 python2.5])
71 if test -z "$PYTHON"; then
72   AC_MSG_ERROR([Python is required])
73 fi
74
75 EMPATHY_ARG_VALGRIND
76
77 # -----------------------------------------------------------
78 # Pkg-Config dependency checks
79 # -----------------------------------------------------------
80
81 PKG_CHECK_MODULES(LIBEMPATHY,
82 [
83    glib-2.0 >= $GLIB_REQUIRED
84    gobject-2.0
85    libxml-2.0
86    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
87    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
88 ])
89
90 PKG_CHECK_MODULES(EMPATHY,
91 [
92    glib-2.0 >= $GLIB_REQUIRED
93    gobject-2.0
94    gio-2.0 >= $GLIB_REQUIRED
95    gconf-2.0 >= $GCONF_REQUIRED
96    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
97    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
98    gtk+-2.0 >= $GTK_REQUIRED
99    x11
100    libglade-2.0 >= $LIBGLADE_REQUIRED
101    libebook-1.2
102 ])
103
104 # -----------------------------------------------------------
105 # Language Support
106 # -----------------------------------------------------------
107
108 GETTEXT_PACKAGE=empathy
109 AC_SUBST(GETTEXT_PACKAGE)
110 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
111
112 AM_GLIB_GNU_GETTEXT
113
114 dnl ================================================================
115 dnl spellchecking checks: enchant and iso-codes
116 dnl ================================================================
117
118 ENCHANT_REQUIRED=1.2.0
119 ISO_CODES_REQUIRED=0.35
120
121 AC_ARG_ENABLE([spell],
122         AS_HELP_STRING([--disable-spell],[Disable spell checking (default: enabled)]),
123         [enable_enchant=$enableval],
124         [enable_enchant=yes])
125
126 if test "x$enable_enchant" = "xyes" ; then
127
128         PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED, \
129                           have_enchant=yes, have_enchant=no)
130
131         if test "x$have_enchant" = "xyes"; then
132
133                 PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED],
134                                  [have_iso_codes=yes],[have_iso_codes=no])
135
136                 if test "x$have_iso_codes" = "xyes"; then
137                         AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
138                         if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
139                            $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
140                                 result=yes
141                         else
142                                 result=no
143                                 have_iso_codes=no
144                         fi
145                         AC_MSG_RESULT([$result])
146                 fi
147
148                 if test "x$have_iso_codes" = "xyes"; then
149                         AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
150                         AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package])
151                 else
152                         AC_MSG_ERROR([iso-codes is required for spellchecking. Use --disable-spell to build without spellchecking support.])
153                 fi
154
155                 enable_enchant=yes
156                 ENCHANT_CFLAGS="${ENCHANT_CFLAGS}"
157                 ENCHANT_LIBS="${ENCHANT_LIBS}"
158                 AC_DEFINE([HAVE_ENCHANT],[1],[Define if you have libenchant])
159         else
160                 AC_MSG_ERROR([Enchant library not found or too old. Use --disable-spell to build without spellchecking support.])
161         fi
162 else
163         enable_enchant=no
164         ENCHANT_CFLAGS=
165         ENCHANT_LIBS=
166 fi
167
168 AC_SUBST(ENCHANT_CFLAGS)
169 AC_SUBST(ENCHANT_LIBS)
170
171
172 # -----------------------------------------------------------
173 # Megaphone
174 # -----------------------------------------------------------
175 AC_ARG_ENABLE(megaphone,
176               AS_HELP_STRING([--enable-megaphone=@<:@no/yes/auto@:>@],
177                              [build megaphone applet]), ,
178                              enable_megaphone=auto)
179
180 if test "x$enable_megaphone" != "xno"; then
181    PKG_CHECK_MODULES(MEGAPHONE, 
182    [
183       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
184       glib-2.0 >= $GLIB_REQUIRED
185       gtk+-2.0 >= $GTK_REQUIRED
186       gconf-2.0 >= $GCONF_REQUIRED
187       libglade-2.0 >= $LIBGLADE_REQUIRED 
188       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
189    ], have_megaphone="yes", have_megaphone="no")
190 else
191    have_megaphone=no
192 fi
193
194 if test "x$enable_megaphone" = "xyes" -a "x$have_megaphone" != "xyes"; then
195    AC_MSG_ERROR([Couldn't find megaphone dependencies.])
196 fi
197
198 AM_CONDITIONAL(HAVE_MEGAPHONE, test "x$have_megaphone" = "xyes")
199
200 # -----------------------------------------------------------
201 # Nothere
202 # -----------------------------------------------------------
203 AC_ARG_ENABLE(nothere,
204               AS_HELP_STRING([--enable-nothere=@<:@no/yes/auto@:>@],
205                              [build nothere applet]), ,
206                              enable_nothere=auto)
207
208 if test "x$enable_nothere" != "xno"; then
209    PKG_CHECK_MODULES(NOTHERE, 
210    [
211       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
212       glib-2.0 >= $GLIB_REQUIRED
213       gtk+-2.0 >= $GTK_REQUIRED
214       gconf-2.0 >= $GCONF_REQUIRED
215       libglade-2.0 >= $LIBGLADE_REQUIRED 
216       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
217    ], have_nothere="yes", have_nothere="no")
218 else
219    have_nothere=no
220 fi
221
222 if test "x$enable_nothere" = "xyes" -a "x$have_nothere" != "xyes"; then
223    AC_MSG_ERROR([Couldn't find nothere dependencies.])
224 fi
225
226 AM_CONDITIONAL(HAVE_NOTHERE, test "x$have_nothere" = "xyes")
227
228 # -----------------------------------------------------------
229 # Tests
230 # -----------------------------------------------------------
231 AC_ARG_ENABLE(tests,
232               AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@],
233                              [build tests]), ,
234                              enable_tests=auto)
235
236 if test "x$enable_tests" != "xno"; then
237    PKG_CHECK_MODULES(CHECK,
238    [
239       check >= 0.9.4
240    ], have_check="yes", have_check="no")
241 else
242    have_check=no
243 fi
244
245 if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then
246    AC_MSG_ERROR([Couldn't find check dependencies.])
247 fi
248
249 AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes")
250
251 # -----------------------------------------------------------
252 # Python Bindings
253 # -----------------------------------------------------------
254 AC_ARG_ENABLE(python,
255               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
256                              [build python bindings to libempathy and libempathy-gtk]), ,
257                              enable_python=auto)
258
259 if test "x$enable_python" != "xno"; then
260    AM_PATH_PYTHON
261    if test -z "$PYTHON" ; then
262       have_python="no"
263    else
264       PKG_CHECK_MODULES(PYTHON_BINDING,
265       [
266          pygtk-2.0,
267          glib-2.0 >= $GLIB_REQUIRED
268          gobject-2.0
269          gconf-2.0 >= $GCONF_REQUIRED
270          libxml-2.0
271          libmissioncontrol >= $MISSION_CONTROL_REQUIRED
272          gtk+-2.0 >= $GTK_REQUIRED
273          libglade-2.0 >= $LIBGLADE_REQUIRED
274       ], have_python="yes", have_python="no")
275       if test "x$have_python" = "xyes" ; then
276          AM_CHECK_PYTHON_HEADERS(,have_python="no")
277       fi
278    fi
279 else
280    have_python=no
281 fi
282
283 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
284    AC_MSG_ERROR([Couldn't find python.])
285 fi
286
287 AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
288
289 # -----------------------------------------------------------
290 # VoIP support
291 # -----------------------------------------------------------
292 AC_ARG_ENABLE(voip,
293               AS_HELP_STRING([--enable-voip=@<:@no/yes@:>@],
294                              [Add support for Voice and Video call]), ,
295                              enable_voip=yes)
296
297 if test "x$enable_voip" = "xyes"; then
298    AC_DEFINE(HAVE_VOIP, 1, [Define if we have voip])
299 fi
300
301 AM_CONDITIONAL(HAVE_VOIP, test "x$enable_voip" = "xyes")
302
303 # -----------------------------------------------------------
304
305 AC_OUTPUT([
306    Makefile
307    data/Makefile
308    data/empathy.desktop.in
309    data/icons/Makefile
310    extensions/Makefile
311    po/Makefile.in
312    libempathy/Makefile
313    libempathy/libempathy.pc
314    libempathy-gtk/Makefile
315    libempathy-gtk/libempathy-gtk.pc
316    src/Makefile
317    megaphone/Makefile
318    megaphone/src/Makefile
319    megaphone/data/Makefile
320    nothere/Makefile
321    nothere/src/Makefile
322    nothere/data/Makefile
323    docs/Makefile
324    docs/libempathy/Makefile
325    docs/libempathy/version.xml
326    docs/libempathy-gtk/Makefile
327    docs/libempathy-gtk/version.xml
328    help/Makefile
329    python/Makefile
330    python/pyempathy/Makefile
331    python/pyempathygtk/Makefile
332    tests/Makefile
333    tests/xml/Makefile
334    tools/Makefile
335 ])