Merge branch 'irc-dialog-579800'
[empathy.git] / configure.ac
1 AC_INIT(Empathy, 2.27.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-2008 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=22
13 LIBEMPATHY_AGE=0
14 LIBEMPATHY_REVISION=0
15
16 LIBEMPATHY_GTK_CURRENT=21
17 LIBEMPATHY_GTK_AGE=2
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.16.0
29 GTK_REQUIRED=2.16.0
30 GCONF_REQUIRED=1.2.0
31 LIBPANELAPPLET_REQUIRED=2.10.0
32 TELEPATHY_GLIB_REQUIRED=0.7.27
33 MISSION_CONTROL_REQUIRED=4.61
34 ENCHANT_REQUIRED=1.2.0
35 ISO_CODES_REQUIRED=0.35
36 LIBNOTIFY_REQUIRED=0.4.4
37 LIBCANBERRA_GTK_REQUIRED=0.4
38
39 # Use --enable-maintainer-mode to disabled deprecated symbols
40 GNOME_MAINTAINER_MODE_DEFINES
41
42 # Uncomment that to build with single include disabled
43 #AC_DEFINE(G_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GLib])
44 #AC_DEFINE(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GDK pixbuf])
45 #AC_DEFINE(GTK_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GTK])
46
47 AC_CONFIG_MACRO_DIR([m4])
48 AC_CONFIG_HEADERS([config.h])
49 AC_CONFIG_SRCDIR([configure.ac])
50 AC_CONFIG_AUX_DIR(.)
51
52 GNOME_COMMON_INIT
53
54 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define -Wno-portability)
55 AC_ISC_POSIX
56 AC_PROG_CC
57 AC_HEADER_STDC
58 AM_PROG_LIBTOOL
59 AM_PROG_MKDIR_P
60 AM_PATH_GLIB_2_0
61 AC_PATH_XTRA
62 IT_PROG_INTLTOOL([0.35.0])
63 GTK_DOC_CHECK([1.3])
64 GNOME_DOC_INIT
65 IDT_COMPILE_WARNINGS
66 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
67 AC_PATH_PROG(GCONFTOOL, gconftool-2)
68 AM_GCONF_SOURCE_2
69 GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
70 AC_SUBST(GLIB_GENMARSHAL)
71
72 AC_CHECK_PROGS([XSLTPROC], [xsltproc])
73 if test -z "$XSLTPROC"; then
74   AC_MSG_ERROR([xsltproc (from libxslt) is required])
75 fi
76 AM_PATH_PYTHON([2.3])
77
78 EMPATHY_ARG_VALGRIND
79
80 # -----------------------------------------------------------
81 # Pkg-Config dependency checks
82 # -----------------------------------------------------------
83
84 PKG_CHECK_MODULES(LIBEMPATHY,
85 [
86    glib-2.0 >= $GLIB_REQUIRED
87    gobject-2.0
88    gio-2.0 >= $GLIB_REQUIRED
89    gio-unix-2.0 >= $GLIB_REQUIRED
90    libxml-2.0
91    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
92    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
93    telepathy-farsight
94 ])
95
96 PKG_CHECK_MODULES(LIBEMPATHYGTK,
97 [
98    glib-2.0 >= $GLIB_REQUIRED
99    gobject-2.0
100    gio-2.0 >= $GLIB_REQUIRED
101    gconf-2.0 >= $GCONF_REQUIRED
102    x11
103    gtk+-2.0 >= $GTK_REQUIRED
104    libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED
105    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
106    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
107    telepathy-farsight
108    gstreamer-0.10
109    gstreamer-interfaces-0.10
110 ])
111
112 PKG_CHECK_MODULES(EMPATHY,
113 [
114    glib-2.0 >= $GLIB_REQUIRED
115    gobject-2.0
116    gio-2.0 >= $GLIB_REQUIRED
117    gconf-2.0 >= $GCONF_REQUIRED
118    x11
119    gtk+-2.0 >= $GTK_REQUIRED
120    libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED
121    libebook-1.2
122    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
123    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
124    telepathy-farsight
125    gstreamer-0.10
126    gstreamer-interfaces-0.10
127 ])
128
129 PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
130
131 # -----------------------------------------------------------
132 # Enable debug
133 # -----------------------------------------------------------
134
135 AC_ARG_ENABLE(debug,
136   AC_HELP_STRING([--disable-debug],[compile without debug code]),
137     enable_debug=$enableval, enable_debug=yes )
138
139 if test x$enable_debug = xyes; then
140   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
141 fi
142
143 # -----------------------------------------------------------
144 # Language Support
145 # -----------------------------------------------------------
146
147 GETTEXT_PACKAGE=empathy
148 AC_SUBST(GETTEXT_PACKAGE)
149 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
150
151 AM_GLIB_GNU_GETTEXT
152
153 # -----------------------------------------------------------
154 # spellchecking checks: enchant and iso-codes
155 # -----------------------------------------------------------
156 AC_ARG_ENABLE(spell,
157               AS_HELP_STRING([--enable-spell=@<:@no/yes/auto@:>@],
158                              [Enable spell checking]), ,
159                              enable_spell=auto)
160
161 if test "x$enable_spell" != "xno"; then
162    PKG_CHECK_MODULES(ENCHANT,
163    [
164       enchant >= $ENCHANT_REQUIRED,
165       iso-codes >= $ISO_CODES_REQUIRED
166    ], have_enchant="yes", have_enchant="no")
167
168    if test "x$have_enchant" = "xyes"; then
169       AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
170       if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
171          $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
172             AC_DEFINE_UNQUOTED(ISO_CODES_PREFIX, ["`$PKG_CONFIG --variable=prefix iso-codes`"], [ISO codes prefix])
173             AC_DEFINE(HAVE_ENCHANT, [], [Define if you have libenchant])
174             result=yes
175       else
176             result=no
177             have_enchant="no"
178       fi
179       AC_MSG_RESULT([$result])
180    fi
181 else
182    have_enchant=no
183 fi
184
185 if test "x$enable_spell" = "xyes" -a "x$have_enchant" != "xyes"; then
186    AC_MSG_ERROR([Couldn't find spell dependencies.])
187 fi
188
189 AM_CONDITIONAL(HAVE_ENCHANT, test "x$have_enchant" = "xyes")
190
191 # -----------------------------------------------------------
192 # Megaphone
193 # -----------------------------------------------------------
194 AC_ARG_ENABLE(megaphone,
195               AS_HELP_STRING([--enable-megaphone=@<:@no/yes/auto@:>@],
196                              [build megaphone applet]), ,
197                              enable_megaphone=auto)
198
199 if test "x$enable_megaphone" != "xno"; then
200    PKG_CHECK_MODULES(MEGAPHONE, 
201    [
202       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
203       glib-2.0 >= $GLIB_REQUIRED
204       gtk+-2.0 >= $GTK_REQUIRED
205       gconf-2.0 >= $GCONF_REQUIRED
206       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
207    ], have_megaphone="yes", have_megaphone="no")
208 else
209    have_megaphone=no
210 fi
211
212 if test "x$enable_megaphone" = "xyes" -a "x$have_megaphone" != "xyes"; then
213    AC_MSG_ERROR([Couldn't find megaphone dependencies.])
214 fi
215
216 AM_CONDITIONAL(HAVE_MEGAPHONE, test "x$have_megaphone" = "xyes")
217
218 # -----------------------------------------------------------
219 # Nothere
220 # -----------------------------------------------------------
221 AC_ARG_ENABLE(nothere,
222               AS_HELP_STRING([--enable-nothere=@<:@no/yes/auto@:>@],
223                              [build nothere applet]), ,
224                              enable_nothere=auto)
225
226 if test "x$enable_nothere" != "xno"; then
227    PKG_CHECK_MODULES(NOTHERE, 
228    [
229       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
230       glib-2.0 >= $GLIB_REQUIRED
231       gtk+-2.0 >= $GTK_REQUIRED
232       gconf-2.0 >= $GCONF_REQUIRED
233       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
234    ], have_nothere="yes", have_nothere="no")
235 else
236    have_nothere=no
237 fi
238
239 if test "x$enable_nothere" = "xyes" -a "x$have_nothere" != "xyes"; then
240    AC_MSG_ERROR([Couldn't find nothere dependencies.])
241 fi
242
243 AM_CONDITIONAL(HAVE_NOTHERE, test "x$have_nothere" = "xyes")
244
245 # -----------------------------------------------------------
246 # Tests
247 # -----------------------------------------------------------
248 AC_ARG_ENABLE(tests,
249               AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@],
250                              [build tests]), ,
251                              enable_tests=auto)
252
253 if test "x$enable_tests" != "xno"; then
254    PKG_CHECK_MODULES(CHECK,
255    [
256       check >= 0.9.4
257    ], have_check="yes", have_check="no")
258 else
259    have_check=no
260 fi
261
262 if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then
263    AC_MSG_ERROR([Couldn't find check dependencies.])
264 fi
265
266 AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes")
267
268 # -----------------------------------------------------------
269 # Python Bindings
270 # -----------------------------------------------------------
271 AC_ARG_ENABLE(python,
272               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
273                              [build python bindings to libempathy and libempathy-gtk]), ,
274                              enable_python=auto)
275
276 if test "x$enable_python" != "xno"; then
277    PKG_CHECK_MODULES(PYTHON_BINDING,
278    [
279       pygtk-2.0,
280       glib-2.0 >= $GLIB_REQUIRED
281       gobject-2.0
282       gconf-2.0 >= $GCONF_REQUIRED
283       libxml-2.0
284       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
285       gtk+-2.0 >= $GTK_REQUIRED
286       gstreamer-0.10
287       gstreamer-interfaces-0.10
288       telepathy-farsight
289    ], have_python="yes", have_python="no")
290    if test "x$have_python" = "xyes" ; then
291       AM_CHECK_PYTHON_HEADERS(,have_python="no")
292       AC_CHECK_PROGS([PYGOBJECTCODEGEN], [pygobject-codegen-2.0 pygtk-codegen-2.0])
293    fi
294 else
295    have_python=no
296 fi
297
298 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
299    AC_MSG_ERROR([Couldn't find python.])
300 fi
301
302 AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
303
304 # -----------------------------------------------------------
305
306 AC_OUTPUT([
307    Makefile
308    data/Makefile
309    data/empathy.desktop.in
310    data/icons/Makefile
311    extensions/Makefile
312    po/Makefile.in
313    libempathy/Makefile
314    libempathy/libempathy.pc
315    libempathy-gtk/Makefile
316    libempathy-gtk/libempathy-gtk.pc
317    src/Makefile
318    megaphone/Makefile
319    megaphone/src/Makefile
320    megaphone/data/Makefile
321    nothere/Makefile
322    nothere/src/Makefile
323    nothere/data/Makefile
324    docs/Makefile
325    docs/libempathy/Makefile
326    docs/libempathy/version.xml
327    docs/libempathy-gtk/Makefile
328    docs/libempathy-gtk/version.xml
329    help/Makefile
330    python/Makefile
331    python/pyempathy/Makefile
332    python/pyempathygtk/Makefile
333    tests/Makefile
334    tests/xml/Makefile
335    tools/Makefile
336 ])