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