]> git.0d.be Git - empathy.git/blob - configure.ac
Merge back from master
[empathy.git] / configure.ac
1 AC_INIT(Empathy, 2.27.90, 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=28
13 LIBEMPATHY_AGE=1
14 LIBEMPATHY_REVISION=0
15
16 LIBEMPATHY_GTK_CURRENT=26
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.16.0
30 GCONF_REQUIRED=1.2.0
31 LIBPANELAPPLET_REQUIRED=2.10.0
32 TELEPATHY_GLIB_REQUIRED=0.7.34
33 ENCHANT_REQUIRED=1.2.0
34 ISO_CODES_REQUIRED=0.35
35 LIBNOTIFY_REQUIRED=0.4.4
36 LIBCANBERRA_GTK_REQUIRED=0.4
37 LIBCHAMPLAIN_REQUIRED=0.3.6
38 LIBCHAMPLAIN_GTK_REQUIRED=0.3.6
39 CLUTTER_GTK_REQUIRED=0.10
40 GEOCLUE_REQUIRED=0.11
41 WEBKIT_REQUIRED=1.1.7
42 NETWORK_MANAGER_REQUIRED=0.7.0
43
44 # Use --enable-maintainer-mode to disabled deprecated symbols
45 GNOME_MAINTAINER_MODE_DEFINES
46
47 # Uncomment that to build with single include disabled
48 #AC_DEFINE(G_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GLib])
49 #AC_DEFINE(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GDK pixbuf])
50 #AC_DEFINE(GTK_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GTK])
51
52 AC_CONFIG_MACRO_DIR([m4])
53 AC_CONFIG_HEADERS([config.h])
54 AC_CONFIG_SRCDIR([configure.ac])
55 AC_CONFIG_AUX_DIR(.)
56
57 GNOME_COMMON_INIT
58
59 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define -Wno-portability)
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    telepathy-farsight
98    farsight2-0.10
99    gstreamer-0.10
100 ])
101
102 PKG_CHECK_MODULES(LIBEMPATHYGTK,
103 [
104    glib-2.0 >= $GLIB_REQUIRED
105    gobject-2.0
106    gio-2.0 >= $GLIB_REQUIRED
107    gconf-2.0 >= $GCONF_REQUIRED
108    x11
109    gtk+-2.0 >= $GTK_REQUIRED
110    libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED
111    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
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    gdk-x11-2.0
123    gtk+-2.0 >= $GTK_REQUIRED
124    libebook-1.2
125    dbus-glib-1
126    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
127    telepathy-farsight
128    gstreamer-0.10
129    unique-1.0
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 # Connectivity integration
158 # -----------------------------------------------------------
159 AC_ARG_WITH(connectivity,
160               AS_HELP_STRING([--with-connectivity=@<:@nm/connman/auto/no@:>@],
161                              [build with connectivity support]), ,
162                              with_connectivity=auto)
163
164 if test "x$with_connectivity" = "xno"; then
165    have_nm=no
166    have_connman=no
167
168 elif test "x$with_connectivity" = "xconnman"; then
169
170    PKG_CHECK_MODULES(CONNMAN,
171    [
172       dbus-glib-1
173    ], have_connman="yes", have_connman="no")
174
175    if test "x$have_connman" = "xyes"; then
176       AC_DEFINE(HAVE_CONNMAN, 1, [Define if you have connman dependencies])
177       have_nm=no
178    fi
179
180 else
181
182    PKG_CHECK_MODULES(NETWORK_MANAGER,
183    [
184       libnm_glib >= $NETWORK_MANAGER_REQUIRED
185    ], have_nm="yes", have_nm="no")
186
187    if test "x$have_nm" = "xyes"; then
188       AC_DEFINE(HAVE_NM, 1, [Define if you have libnm-glib])
189       have_connman=no
190    fi
191 fi
192
193 if test "x$with_connectivity" = "xconnman" -a "x$have_connman" != "xyes"; then
194    AC_MSG_ERROR([Couldn't find connman dependencies.])
195 fi
196
197 if test "x$with_connectivity" = "xnm" -a "x$have_nm" != "xyes"; then
198    AC_MSG_ERROR([Couldn't find libnm-glib dependencies.])
199 fi
200
201 AM_CONDITIONAL(HAVE_NM, test "x$have_nm" = "xyes")
202 AM_CONDITIONAL(HAVE_CONNMAN, test "x$have_connman" = "xyes")
203
204 # -----------------------------------------------------------
205 # Webkit
206 # -----------------------------------------------------------
207 AC_ARG_ENABLE(webkit,
208               AS_HELP_STRING([--enable-webkit=@<:@no/yes/auto@:>@],
209                              [build with webkit support]), ,
210                              enable_webkit=auto)
211
212 if test "x$enable_webkit" != "xno"; then
213    PKG_CHECK_MODULES(WEBKIT,
214    [
215       webkit-1.0 >= $WEBKIT_REQUIRED
216    ], have_webkit="yes", have_webkit="no")
217
218    if test "x$have_webkit" = "xyes"; then
219       AC_DEFINE(HAVE_WEBKIT, 1, [Define if you have libwebkitgtk])
220    fi
221 else
222    have_webkit=no
223 fi
224
225 if test "x$enable_webkit" = "xyes" -a "x$have_webkit" != "xyes"; then
226    AC_MSG_ERROR([Couldn't find webkit dependencies.])
227 fi
228 AM_CONDITIONAL(HAVE_WEBKIT, test "x$have_webkit" = "xyes")
229
230 # -----------------------------------------------------------
231 # spellchecking checks: enchant and iso-codes
232 # -----------------------------------------------------------
233 AC_ARG_ENABLE(spell,
234               AS_HELP_STRING([--enable-spell=@<:@no/yes/auto@:>@],
235                              [Enable spell checking]), ,
236                              enable_spell=auto)
237
238 if test "x$enable_spell" != "xno"; then
239    PKG_CHECK_MODULES(ENCHANT,
240    [
241       enchant >= $ENCHANT_REQUIRED,
242       iso-codes >= $ISO_CODES_REQUIRED
243    ], have_enchant="yes", have_enchant="no")
244
245    if test "x$have_enchant" = "xyes"; then
246       AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
247       if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
248          $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
249             AC_DEFINE_UNQUOTED(ISO_CODES_PREFIX, ["`$PKG_CONFIG --variable=prefix iso-codes`"], [ISO codes prefix])
250             AC_DEFINE(HAVE_ENCHANT, [], [Define if you have libenchant])
251             result=yes
252       else
253             result=no
254             have_enchant="no"
255       fi
256       AC_MSG_RESULT([$result])
257    fi
258 else
259    have_enchant=no
260 fi
261
262 if test "x$enable_spell" = "xyes" -a "x$have_enchant" != "xyes"; then
263    AC_MSG_ERROR([Couldn't find spell dependencies.])
264 fi
265
266 AM_CONDITIONAL(HAVE_ENCHANT, test "x$have_enchant" = "xyes")
267
268 # -----------------------------------------------------------
269 # Map view checks: libchamplain
270 # -----------------------------------------------------------
271 AC_ARG_ENABLE(map,
272               AS_HELP_STRING([--enable-map=@<:@no/yes/auto@:>@],
273                              [Enable map view]), ,
274                              enable_map=auto)
275
276 if test "x$enable_map" != "xno"; then
277    PKG_CHECK_MODULES(LIBCHAMPLAIN,
278    [
279       champlain-0.3 >= $LIBCHAMPLAIN_REQUIRED,
280       champlain-gtk-0.3 >= $LIBCHAMPLAIN_GTK_REQUIRED
281       clutter-gtk-0.10 >= $CLUTTER_GTK_REQUIRED
282    ], have_libchamplain="yes", have_libchamplain="no")
283
284    if test "x$have_libchamplain" = "xyes"; then
285       AC_DEFINE(HAVE_LIBCHAMPLAIN, 1, [Define if you have libchamplain])
286    fi
287 else
288    have_libchamplain=no
289 fi
290
291 if test "x$enable_map" = "xyes" -a "x$have_libchamplain" != "xyes"; then
292    AC_MSG_ERROR([Couldn't find map view dependencies.])
293 fi
294
295 AM_CONDITIONAL(HAVE_LIBCHAMPLAIN, test "x$have_libchamplain" = "xyes")
296
297 # -----------------------------------------------------------
298 # location checks: geoclue
299 # -----------------------------------------------------------
300 AC_ARG_ENABLE(location,
301               AS_HELP_STRING([--enable-location=@<:@no/yes/auto@:>@],
302                              [Enable location awareness]), ,
303                              enable_location=auto)
304
305 if test "x$enable_location" != "xno"; then
306    PKG_CHECK_MODULES(GEOCLUE,
307    [
308       geoclue >= $GEOCLUE_REQUIRED
309    ], have_geoclue="yes", have_geoclue="no")
310
311    if test "x$have_geoclue" = "xyes"; then
312       AC_DEFINE(HAVE_GEOCLUE, 1, [Define if you have geoclue])
313    fi
314 else
315    have_geoclue="no"
316 fi
317
318 if test "x$enable_location" = "xyes" -a "x$have_geoclue" != "xyes"; then
319    AC_MSG_ERROR([Couldn't find location dependencies.])
320 fi
321
322 AM_CONDITIONAL(HAVE_GEOCLUE, test "x$have_geoclue" = "xyes")
323 AC_SUBST(GEOCLUE_CFLAGS)
324 AC_SUBST(GEOCLUE_LIBS)
325
326 # -----------------------------------------------------------
327 # Megaphone
328 # -----------------------------------------------------------
329 AC_ARG_ENABLE(megaphone,
330               AS_HELP_STRING([--enable-megaphone=@<:@no/yes/auto@:>@],
331                              [build megaphone applet]), ,
332                              enable_megaphone=auto)
333
334 if test "x$enable_megaphone" != "xno"; then
335    PKG_CHECK_MODULES(MEGAPHONE, 
336    [
337       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
338       glib-2.0 >= $GLIB_REQUIRED
339       gtk+-2.0 >= $GTK_REQUIRED
340       gconf-2.0 >= $GCONF_REQUIRED
341       telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
342    ], have_megaphone="yes", have_megaphone="no")
343 else
344    have_megaphone=no
345 fi
346
347 if test "x$enable_megaphone" = "xyes" -a "x$have_megaphone" != "xyes"; then
348    AC_MSG_ERROR([Couldn't find megaphone dependencies.])
349 fi
350
351 AM_CONDITIONAL(HAVE_MEGAPHONE, test "x$have_megaphone" = "xyes")
352
353 # -----------------------------------------------------------
354 # Nothere
355 # -----------------------------------------------------------
356 AC_ARG_ENABLE(nothere,
357               AS_HELP_STRING([--enable-nothere=@<:@no/yes/auto@:>@],
358                              [build nothere applet]), ,
359                              enable_nothere=auto)
360
361 if test "x$enable_nothere" != "xno"; then
362    PKG_CHECK_MODULES(NOTHERE, 
363    [
364       libpanelapplet-2.0 >= $LIBPANELAPPLET_REQUIRED
365       glib-2.0 >= $GLIB_REQUIRED
366       gtk+-2.0 >= $GTK_REQUIRED
367       gconf-2.0 >= $GCONF_REQUIRED
368       telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
369    ], have_nothere="yes", have_nothere="no")
370 else
371    have_nothere=no
372 fi
373
374 if test "x$enable_nothere" = "xyes" -a "x$have_nothere" != "xyes"; then
375    AC_MSG_ERROR([Couldn't find nothere dependencies.])
376 fi
377
378 AM_CONDITIONAL(HAVE_NOTHERE, test "x$have_nothere" = "xyes")
379
380 # -----------------------------------------------------------
381 # Tests
382 # -----------------------------------------------------------
383 AC_ARG_ENABLE(tests,
384               AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@],
385                              [build tests]), ,
386                              enable_tests=auto)
387
388 if test "x$enable_tests" != "xno"; then
389    PKG_CHECK_MODULES(CHECK,
390    [
391       check >= 0.9.4
392    ], have_check="yes", have_check="no")
393 else
394    have_check=no
395 fi
396
397 if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then
398    AC_MSG_ERROR([Couldn't find check dependencies.])
399 fi
400
401 AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes")
402
403 # -----------------------------------------------------------
404 # Python Bindings
405 # -----------------------------------------------------------
406 AC_ARG_ENABLE(python,
407               AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
408                              [build python bindings to libempathy and libempathy-gtk]), ,
409                              enable_python=auto)
410
411 if test "x$enable_python" != "xno"; then
412    PKG_CHECK_MODULES(PYTHON_BINDING,
413    [
414       pygtk-2.0,
415       glib-2.0 >= $GLIB_REQUIRED
416       gobject-2.0
417       gconf-2.0 >= $GCONF_REQUIRED
418       libxml-2.0
419       gtk+-2.0 >= $GTK_REQUIRED
420       gstreamer-0.10
421       gstreamer-interfaces-0.10
422       telepathy-farsight
423    ], have_python="yes", have_python="no")
424    if test "x$have_python" = "xyes" ; then
425       AM_CHECK_PYTHON_HEADERS(,have_python="no")
426       AC_CHECK_PROGS([PYGOBJECTCODEGEN], [pygobject-codegen-2.0 pygtk-codegen-2.0])
427    fi
428 else
429    have_python=no
430 fi
431
432 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
433    AC_MSG_ERROR([Couldn't find python.])
434 fi
435
436 AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")
437
438 # -----------------------------------------------------------
439 # Coding style checks
440 # -----------------------------------------------------------
441 AC_ARG_ENABLE(coding-style-checks,
442   AC_HELP_STRING([--disable-coding-style-checks],
443                  [don't check coding style using grep]),
444     [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
445
446 AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
447 # -----------------------------------------------------------
448
449 SHAVE_INIT(.)
450
451 AC_OUTPUT([
452    Makefile
453    data/Makefile
454    data/empathy.desktop.in
455    data/icons/Makefile
456    extensions/Makefile
457    po/Makefile.in
458    libempathy/Makefile
459    libempathy/libempathy.pc
460    libempathy-gtk/Makefile
461    libempathy-gtk/libempathy-gtk.pc
462    src/Makefile
463    megaphone/Makefile
464    megaphone/src/Makefile
465    megaphone/data/Makefile
466    nothere/Makefile
467    nothere/src/Makefile
468    nothere/data/Makefile
469    docs/Makefile
470    docs/libempathy/Makefile
471    docs/libempathy/version.xml
472    docs/libempathy-gtk/Makefile
473    docs/libempathy-gtk/version.xml
474    help/Makefile
475    python/Makefile
476    python/pyempathy/Makefile
477    python/pyempathygtk/Makefile
478    tests/Makefile
479    tests/xml/Makefile
480    tools/Makefile
481    shave
482    shave-libtool
483 ])
484
485 echo "
486 Configure summary:
487
488         Compiler....................:  ${CC}
489         Compiler Flags..............:  ${CFLAGS}
490         Prefix......................:  ${prefix}
491         Shaved build................:  ${enable_shave}
492         Tests.......................:  ${have_check}
493         Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
494
495     Features:
496         Spell checking (enchant)....:  ${have_enchant}
497         Display maps (libchamplain).:  ${have_libchamplain}
498         Location awareness (Geoclue):  ${have_geoclue}
499         Adium themes (Webkit).......:  ${have_webkit}
500
501     Connectivity:
502         NetworkManager integration..:  ${have_nm}
503         ConnMan integration.........:  ${have_connman}
504
505     Extras:
506         Documentation...............:  ${enable_gtk_doc}
507         Python bindings.............:  ${have_python}
508         Megaphone applet............:  ${have_megaphone}
509         Nothere applet..............:  ${have_nothere}
510 "