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