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