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