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