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