]> git.0d.be Git - empathy.git/blob - configure.ac
Build fix
[empathy.git] / configure.ac
1 AC_INIT(Empathy, 2.27.3, 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=25
13 LIBEMPATHY_AGE=0
14 LIBEMPATHY_REVISION=0
15
16 LIBEMPATHY_GTK_CURRENT=23
17 LIBEMPATHY_GTK_AGE=0
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 GEOCLUE_REQUIRED=0.11
39 LIBCHAMPLAIN_REQUIRED=0.2.6
40 LIBCHAMPLAIN_GTK_REQUIRED=0.2.6
41 CLUTTER_GTK_REQUIRED=0.8.2
42
43 # Use --enable-maintainer-mode to disabled deprecated symbols
44 GNOME_MAINTAINER_MODE_DEFINES
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 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    gio-2.0 >= $GLIB_REQUIRED
93    gio-unix-2.0 >= $GLIB_REQUIRED
94    libxml-2.0
95    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
96    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
97    telepathy-farsight
98 ])
99
100 PKG_CHECK_MODULES(LIBEMPATHYGTK,
101 [
102    glib-2.0 >= $GLIB_REQUIRED
103    gobject-2.0
104    gio-2.0 >= $GLIB_REQUIRED
105    gconf-2.0 >= $GCONF_REQUIRED
106    x11
107    gtk+-2.0 >= $GTK_REQUIRED
108    libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED
109    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
110    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
111    telepathy-farsight
112    farsight2-0.10
113    gstreamer-0.10
114    gstreamer-interfaces-0.10
115 ])
116
117 PKG_CHECK_MODULES(EMPATHY,
118 [
119    glib-2.0 >= $GLIB_REQUIRED
120    gobject-2.0
121    gio-2.0 >= $GLIB_REQUIRED
122    gconf-2.0 >= $GCONF_REQUIRED
123    x11
124    gtk+-2.0 >= $GTK_REQUIRED
125    libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED
126    libebook-1.2
127    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
128    libmissioncontrol >= $MISSION_CONTROL_REQUIRED
129    telepathy-farsight
130    gstreamer-0.10
131    gstreamer-interfaces-0.10
132 ])
133
134 PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
135
136 # -----------------------------------------------------------
137 # Enable debug
138 # -----------------------------------------------------------
139
140 AC_ARG_ENABLE(debug,
141   AC_HELP_STRING([--disable-debug],[compile without debug code]),
142     enable_debug=$enableval, enable_debug=yes )
143
144 if test x$enable_debug = xyes; then
145   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
146 fi
147
148 # -----------------------------------------------------------
149 # Language Support
150 # -----------------------------------------------------------
151
152 GETTEXT_PACKAGE=empathy
153 AC_SUBST(GETTEXT_PACKAGE)
154 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
155
156 AM_GLIB_GNU_GETTEXT
157
158 # -----------------------------------------------------------
159 # spellchecking checks: enchant and iso-codes
160 # -----------------------------------------------------------
161 AC_ARG_ENABLE(spell,
162               AS_HELP_STRING([--enable-spell=@<:@no/yes/auto@:>@],
163                              [Enable spell checking]), ,
164                              enable_spell=auto)
165
166 if test "x$enable_spell" != "xno"; then
167    PKG_CHECK_MODULES(ENCHANT,
168    [
169       enchant >= $ENCHANT_REQUIRED,
170       iso-codes >= $ISO_CODES_REQUIRED
171    ], have_enchant="yes", have_enchant="no")
172
173    if test "x$have_enchant" = "xyes"; then
174       AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
175       if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
176          $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
177             AC_DEFINE_UNQUOTED(ISO_CODES_PREFIX, ["`$PKG_CONFIG --variable=prefix iso-codes`"], [ISO codes prefix])
178             AC_DEFINE(HAVE_ENCHANT, [], [Define if you have libenchant])
179             result=yes
180       else
181             result=no
182             have_enchant="no"
183       fi
184       AC_MSG_RESULT([$result])
185    fi
186 else
187    have_enchant=no
188 fi
189
190 if test "x$enable_spell" = "xyes" -a "x$have_enchant" != "xyes"; then
191    AC_MSG_ERROR([Couldn't find spell dependencies.])
192 fi
193
194 AM_CONDITIONAL(HAVE_ENCHANT, test "x$have_enchant" = "xyes")
195
196 # -----------------------------------------------------------
197 # Map view checks: libchamplain
198 # -----------------------------------------------------------
199 AC_ARG_ENABLE(map,
200               AS_HELP_STRING([--enable-map=@<:@no/yes/auto@:>@],
201                              [Enable map view]), ,
202                              enable_map=auto)
203
204 if test "x$enable_map" != "xno"; then
205    PKG_CHECK_MODULES(LIBCHAMPLAIN,
206    [
207       champlain-0.2 >= $LIBCHAMPLAIN_REQUIRED,
208       champlain-gtk-0.2 >= $LIBCHAMPLAIN_GTK_REQUIRED
209       clutter-gtk-0.8 >= $CLUTTER_GTK_REQUIRED
210    ], have_libchamplain="yes", have_libchamplain="no")
211
212    if test "x$have_libchamplain" = "xyes"; then
213       AC_DEFINE(HAVE_LIBCHAMPLAIN, 1, [Define if you have libchamplain])
214    else
215        have_libchamplain="no"
216    fi
217 else
218    have_libchamplain=no
219 fi
220
221 if test "x$enable_map" = "xyes" -a "x$have_libchamplain" != "xyes"; then
222    AC_MSG_ERROR([Couldn't find map view dependencies.])
223 fi
224
225 AM_CONDITIONAL(HAVE_LIBCHAMPLAIN, test "x$have_libchamplain" = "xyes")
226
227 # -----------------------------------------------------------
228 # location checks: geoclue
229 # -----------------------------------------------------------
230 AC_ARG_ENABLE(location,
231               AS_HELP_STRING([--enable-location=@<:@no/yes/auto@:>@],
232                              [Enable location awareness]), ,
233                              enable_location=auto)
234
235 if test "x$enable_location" != "xno"; then
236    PKG_CHECK_MODULES(GEOCLUE,
237    [
238       geoclue >= $GEOCLUE_REQUIRED
239    ], have_geoclue="yes", have_geoclue="no")
240
241    if test "x$have_geoclue" = "xyes"; then
242       AC_DEFINE(HAVE_GEOCLUE, 1, [Define if you have geoclue])
243    else
244        have_geoclue="no"
245    fi
246 else
247    have_geoclue=no
248 fi
249
250 if test "x$enable_map" = "xyes" -a "x$have_geoclue" != "xyes"; then
251    AC_MSG_ERROR([Couldn't find location dependencies.])
252 fi
253
254 AM_CONDITIONAL(HAVE_GEOCLUE, test "x$have_geoclue" = "xyes")
255 AC_SUBST(GEOCLUE_CFLAGS)
256 AC_SUBST(GEOCLUE_LIBS)
257
258 # -----------------------------------------------------------
259 # Megaphone
260 # -----------------------------------------------------------
261 AC_ARG_ENABLE(megaphone,
262               AS_HELP_STRING([--enable-megaphone=@<:@no/yes/auto@:>@],
263                              [build megaphone applet]), ,
264                              enable_megaphone=auto)
265
266 if test "x$enable_megaphone" != "xno"; then
267    PKG_CHECK_MODULES(MEGAPHONE, 
268    [
269       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
270       glib-2.0 >= $GLIB_REQUIRED
271       gtk+-2.0 >= $GTK_REQUIRED
272       gconf-2.0 >= $GCONF_REQUIRED
273       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
274    ], have_megaphone="yes", have_megaphone="no")
275 else
276    have_megaphone=no
277 fi
278
279 if test "x$enable_megaphone" = "xyes" -a "x$have_megaphone" != "xyes"; then
280    AC_MSG_ERROR([Couldn't find megaphone dependencies.])
281 fi
282
283 AM_CONDITIONAL(HAVE_MEGAPHONE, test "x$have_megaphone" = "xyes")
284
285 # -----------------------------------------------------------
286 # Nothere
287 # -----------------------------------------------------------
288 AC_ARG_ENABLE(nothere,
289               AS_HELP_STRING([--enable-nothere=@<:@no/yes/auto@:>@],
290                              [build nothere applet]), ,
291                              enable_nothere=auto)
292
293 if test "x$enable_nothere" != "xno"; then
294    PKG_CHECK_MODULES(NOTHERE, 
295    [
296       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
297       glib-2.0 >= $GLIB_REQUIRED
298       gtk+-2.0 >= $GTK_REQUIRED
299       gconf-2.0 >= $GCONF_REQUIRED
300       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
301    ], have_nothere="yes", have_nothere="no")
302 else
303    have_nothere=no
304 fi
305
306 if test "x$enable_nothere" = "xyes" -a "x$have_nothere" != "xyes"; then
307    AC_MSG_ERROR([Couldn't find nothere dependencies.])
308 fi
309
310 AM_CONDITIONAL(HAVE_NOTHERE, test "x$have_nothere" = "xyes")
311
312 # -----------------------------------------------------------
313 # Tests
314 # -----------------------------------------------------------
315 AC_ARG_ENABLE(tests,
316               AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@],
317                              [build tests]), ,
318                              enable_tests=auto)
319
320 if test "x$enable_tests" != "xno"; then
321    PKG_CHECK_MODULES(CHECK,
322    [
323       check >= 0.9.4
324    ], have_check="yes", have_check="no")
325 else
326    have_check=no
327 fi
328
329 if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then
330    AC_MSG_ERROR([Couldn't find check dependencies.])
331 fi
332
333 AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes")
334
335 # -----------------------------------------------------------
336 # Python Bindings
337 # -----------------------------------------------------------
338 AC_ARG_ENABLE(python,
339               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
340                              [build python bindings to libempathy and libempathy-gtk]), ,
341                              enable_python=auto)
342
343 if test "x$enable_python" != "xno"; then
344    PKG_CHECK_MODULES(PYTHON_BINDING,
345    [
346       pygtk-2.0,
347       glib-2.0 >= $GLIB_REQUIRED
348       gobject-2.0
349       gconf-2.0 >= $GCONF_REQUIRED
350       libxml-2.0
351       libmissioncontrol >= $MISSION_CONTROL_REQUIRED
352       gtk+-2.0 >= $GTK_REQUIRED
353       gstreamer-0.10
354       gstreamer-interfaces-0.10
355       telepathy-farsight
356    ], have_python="yes", have_python="no")
357    if test "x$have_python" = "xyes" ; then
358       AM_CHECK_PYTHON_HEADERS(,have_python="no")
359       AC_CHECK_PROGS([PYGOBJECTCODEGEN], [pygobject-codegen-2.0 pygtk-codegen-2.0])
360    fi
361 else
362    have_python=no
363 fi
364
365 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
366    AC_MSG_ERROR([Couldn't find python.])
367 fi
368
369 AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
370
371 # -----------------------------------------------------------
372 # Coding style checks
373 # -----------------------------------------------------------
374 AC_ARG_ENABLE(coding-style-checks,
375   AC_HELP_STRING([--disable-coding-style-checks],
376                  [don't check coding style using grep]),
377     [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
378
379 AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
380 # -----------------------------------------------------------
381
382 SHAVE_INIT(.)
383
384 AC_OUTPUT([
385    Makefile
386    data/Makefile
387    data/empathy.desktop.in
388    data/icons/Makefile
389    extensions/Makefile
390    po/Makefile.in
391    libempathy/Makefile
392    libempathy/libempathy.pc
393    libempathy-gtk/Makefile
394    libempathy-gtk/libempathy-gtk.pc
395    src/Makefile
396    megaphone/Makefile
397    megaphone/src/Makefile
398    megaphone/data/Makefile
399    nothere/Makefile
400    nothere/src/Makefile
401    nothere/data/Makefile
402    docs/Makefile
403    docs/libempathy/Makefile
404    docs/libempathy/version.xml
405    docs/libempathy-gtk/Makefile
406    docs/libempathy-gtk/version.xml
407    help/Makefile
408    python/Makefile
409    python/pyempathy/Makefile
410    python/pyempathygtk/Makefile
411    tests/Makefile
412    tests/xml/Makefile
413    tools/Makefile
414    shave
415    shave-libtool
416 ])
417
418 echo "
419 Configure summary:
420
421         Compiler....................:  ${CC}
422         Compiler Flags..............:  ${CFLAGS}
423         Prefix......................:  ${prefix}
424         Shaved build................:  ${enable_shave}
425         Tests.......................:  ${have_check}
426         Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
427
428         Documentation...............:  ${enable_gtk_doc}
429         Python bindings.............:  ${have_python}
430         Spell checking..............:  ${have_enchant}
431         Megaphone applet............:  ${have_megaphone}
432         Nothere applet..............:  ${have_nothere}
433 "