libempathy-gtk do not depends on libxml2 anymore.
[empathy.git] / configure.ac
1 AC_INIT(Empathy, 0.21.6, 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=9
13 LIBEMPATHY_AGE=2
14 LIBEMPATHY_REVISION=0
15
16 LIBEMPATHY_GTK_CURRENT=9
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.14.0
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_REQUIRED=0.3.1
34 TELEPATHY_GLIB_REQUIRED=0.7.0
35 MISSION_CONTROL_REQUIRED=4.53
36
37 # Uncomment that to build without deprecated symbols
38 # AC_DEFINE(GTK_DISABLE_DEPRECATED, 1, [Disable deprecated GTK symbols])
39 # AC_DEFINE(G_DISABLE_DEPRECATED, 1, [Disable deprecated GLib symbols])
40 # AC_DEFINE(LIBTELEPATHY_DISABLE_DEPRECATED, 1, [Disable deprecated libtelepathy symbols])
41
42 AC_CONFIG_MACRO_DIR([m4])
43 AC_CONFIG_HEADERS([config.h])
44 AC_CONFIG_SRCDIR([configure.ac])
45 AC_CONFIG_AUX_DIR(.)
46
47 GNOME_COMMON_INIT
48
49 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define)
50 AM_MAINTAINER_MODE
51 AC_ISC_POSIX
52 AC_PROG_CC
53 AC_HEADER_STDC
54 AM_PROG_LIBTOOL
55 AM_PATH_GLIB_2_0
56 AC_PATH_XTRA
57 IT_PROG_INTLTOOL([0.35.0])
58 GTK_DOC_CHECK([1.3])
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 EMPATHY_ARG_VALGRIND
67
68 # -----------------------------------------------------------
69 # Pkg-Config dependency checks
70 # -----------------------------------------------------------
71
72 PKG_CHECK_MODULES(LIBEMPATHY,
73 [
74    glib-2.0 >= $GLIB_REQUIRED
75    gobject-2.0
76    gconf-2.0 >= $GCONF_REQUIRED
77    libxml-2.0
78    libtelepathy >= $TELEPATHY_REQUIRED
79    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
80    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
81 ])
82
83 PKG_CHECK_MODULES(EMPATHY,
84 [
85    glib-2.0 >= $GLIB_REQUIRED
86    gobject-2.0
87    gconf-2.0 >= $GCONF_REQUIRED
88    libtelepathy >= $TELEPATHY_REQUIRED
89    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
90    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
91    gnome-vfs-2.0
92    gtk+-2.0 >= $GTK_REQUIRED
93    x11
94    libglade-2.0 >= $LIBGLADE_REQUIRED
95    libebook-1.2
96 ])
97
98 # -----------------------------------------------------------
99 # Language Support
100 # -----------------------------------------------------------
101
102 GETTEXT_PACKAGE=empathy
103 AC_SUBST(GETTEXT_PACKAGE)
104 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
105
106 AM_GLIB_GNU_GETTEXT
107
108 # -----------------------------------------------------------
109 # ISO codes, used for aspell support
110 # -----------------------------------------------------------
111 AC_MSG_CHECKING([whether iso-codes exists and has iso-639 domain])
112 if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 ; then
113    AC_MSG_RESULT([yes])
114    iso_codes_prefix=`$PKG_CONFIG --variable=prefix iso-codes`
115    iso_codes_pkgconfig=iso-codes
116    have_iso_codes=yes
117 else
118    AC_MSG_RESULT([no])
119    iso_codes_prefix=
120    iso_codes_pkgconfig=
121    have_iso_codes=no
122 fi
123
124 AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["$iso_codes_prefix"],[ISO codes prefix])
125
126 # -----------------------------------------------------------
127 # ASpell
128 # -----------------------------------------------------------
129 AC_ARG_ENABLE(aspell,
130               AS_HELP_STRING([--enable-aspell=@<:@no/yes/auto@:>@],
131                              [compile with aspell support]), ,
132                              enable_aspell=auto)
133
134 if test "x$enable_aspell" = "xyes" -a "x$have_iso_codes" != "xyes"; then
135    AC_MSG_ERROR([You must have iso-codes with the iso-639 domain to use aspell.])
136 fi
137
138 if test "x$enable_aspell" != "xno" -a "x$have_iso_codes" = "xyes"; then
139    AC_CHECK_LIB(aspell, aspell_speller_check,have_aspell=yes,have_aspell=no,)
140
141    if test "x$have_aspell" = "xyes"; then
142       AC_DEFINE(HAVE_ASPELL, 1, [Define if we have aspell])
143       EMPATHY_LIBS="$EMPATHY_LIBS -laspell"
144    else
145       have_aspell=no
146    fi
147 else
148    have_aspell=no
149 fi
150
151 if test "x$enable_aspell" = "xyes" -a "x$have_aspell" != "xyes"; then
152    AC_MSG_ERROR([Couldn't find aspell.])
153 fi
154
155
156 # -----------------------------------------------------------
157 # Megaphone
158 # -----------------------------------------------------------
159 AC_ARG_ENABLE(megaphone,
160               AS_HELP_STRING([--enable-megaphone=@<:@no/yes/auto@:>@],
161                              [build megaphone applet]), ,
162                              enable_megaphone=auto)
163
164 if test "x$enable_megaphone" != "xno"; then
165    PKG_CHECK_MODULES(MEGAPHONE, 
166    [
167       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
168       glib-2.0 >= $GLIB_REQUIRED
169       gtk+-2.0 >= $GTK_REQUIRED
170       gconf-2.0 >= $GCONF_REQUIRED
171       libglade-2.0 >= $LIBGLADE_REQUIRED 
172       gnome-vfs-2.0
173       libtelepathy >= $TELEPATHY_REQUIRED
174       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
175    ], have_megaphone="yes", have_megaphone="no")
176 else
177    have_megaphone=no
178 fi
179
180 if test "x$enable_megaphone" = "xyes" -a "x$have_megaphone" != "xyes"; then
181    AC_MSG_ERROR([Couldn't find megaphone dependencies.])
182 fi
183
184 AM_CONDITIONAL(HAVE_MEGAPHONE, test "x$have_megaphone" = "xyes")
185
186 # -----------------------------------------------------------
187 # Nothere
188 # -----------------------------------------------------------
189 AC_ARG_ENABLE(nothere,
190               AS_HELP_STRING([--enable-nothere=@<:@no/yes/auto@:>@],
191                              [build nothere applet]), ,
192                              enable_nothere=no)
193
194 if test "x$enable_nothere" != "xno"; then
195    PKG_CHECK_MODULES(NOTHERE, 
196    [
197       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
198       glib-2.0 >= $GLIB_REQUIRED
199       gtk+-2.0 >= $GTK_REQUIRED
200       gconf-2.0 >= $GCONF_REQUIRED
201       libglade-2.0 >= $LIBGLADE_REQUIRED 
202       libtelepathy >= $TELEPATHY_REQUIRED
203       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
204    ], have_nothere="yes", have_nothere="no")
205 else
206    have_nothere=no
207 fi
208
209 if test "x$enable_nothere" = "xyes" -a "x$have_nothere" != "xyes"; then
210    AC_MSG_ERROR([Couldn't find nothere dependencies.])
211 fi
212
213 AM_CONDITIONAL(HAVE_NOTHERE, test "x$have_nothere" = "xyes")
214
215 # -----------------------------------------------------------
216 # Tests
217 # -----------------------------------------------------------
218 AC_ARG_ENABLE(tests,
219               AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@],
220                              [build tests]), ,
221                              enable_tests=auto)
222
223 if test "x$enable_tests" != "xno"; then
224    PKG_CHECK_MODULES(CHECK,
225    [
226       check >= 0.9.4
227    ], have_check="yes", have_check="no")
228 else
229    have_check=no
230 fi
231
232 if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then
233    AC_MSG_ERROR([Couldn't find check dependencies.])
234 fi
235
236 AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes")
237
238 # -----------------------------------------------------------
239 # Python Bindings
240 # -----------------------------------------------------------
241 AC_ARG_ENABLE(python,
242               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
243                              [build python bindings to libempathy and libempathy-gtk]), ,
244                              enable_python=auto)
245
246 if test "x$enable_python" != "xno"; then
247    AM_PATH_PYTHON
248    if test -z "$PYTHON" ; then
249       have_python="no"
250    else
251       PKG_CHECK_MODULES(PYTHON_BINDING,
252       [
253          pygtk-2.0,
254          glib-2.0 >= $GLIB_REQUIRED
255          gobject-2.0
256          gconf-2.0 >= $GCONF_REQUIRED
257          libxml-2.0
258          gnome-vfs-2.0
259          libtelepathy >= $TELEPATHY_REQUIRED
260          libmissioncontrol >= $MISSION_CONTROL_REQUIRED
261          gtk+-2.0 >= $GTK_REQUIRED
262          libglade-2.0 >= $LIBGLADE_REQUIRED
263       ], have_python="yes", have_python="no")
264    fi
265 else
266    have_python=no
267 fi
268
269 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
270    AC_MSG_ERROR([Couldn't find python.])
271 fi
272
273 AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
274
275 # -----------------------------------------------------------
276 # VoIP support
277 # -----------------------------------------------------------
278 AC_ARG_ENABLE(voip,
279               AS_HELP_STRING([--enable-voip=@<:@no/yes@:>@],
280                              [Add support for Voice and Video call]), ,
281                              enable_voip=no)
282
283 if test "x$enable_voip" = "xyes"; then
284    AC_DEFINE(HAVE_VOIP, 1, [Define if we have voip])
285 fi
286
287 AM_CONDITIONAL(HAVE_VOIP, test "x$enable_voip" = "xyes")
288
289 # -----------------------------------------------------------
290
291 AC_OUTPUT([
292    Makefile
293    data/Makefile
294    data/empathy.desktop.in
295    data/icons/Makefile
296    po/Makefile.in
297    libempathy/Makefile
298    libempathy/libempathy.pc
299    libempathy-gtk/Makefile
300    libempathy-gtk/libempathy-gtk.pc
301    src/Makefile
302    megaphone/Makefile
303    megaphone/src/Makefile
304    megaphone/data/Makefile
305    nothere/Makefile
306    nothere/src/Makefile
307    nothere/data/Makefile
308    docs/Makefile
309    docs/libempathy/Makefile
310    docs/libempathy/version.xml
311    docs/libempathy-gtk/Makefile
312    docs/libempathy-gtk/version.xml
313    python/Makefile
314    python/pyempathy/Makefile
315    python/pyempathygtk/Makefile
316    tests/Makefile
317 ])