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