]> git.0d.be Git - empathy.git/blob - configure.ac
goa-mc-plugin: support enabling or disabling accounts
[empathy.git] / configure.ac
1 dnl If not 1, append datestamp to the version number
2 m4_define(empathy_released, 0)
3
4 m4_define([empathy_major_version], [3])
5 m4_define([empathy_minor_version], [5])
6 m4_define([empathy_micro_version], [1])
7 m4_define([empathy_nano_version], [0])
8
9 dnl Display the nano_version only if it's not '0'
10 m4_define([empathy_base_version],
11           [empathy_major_version.empathy_minor_version.empathy_micro_version])
12 m4_define([empathy_full_version],
13           [m4_if(empathy_nano_version, 0, [empathy_base_version],
14               [empathy_base_version].[empathy_nano_version])])
15
16 m4_define(empathy_maybe_datestamp,
17           m4_esyscmd([if test x]empathy_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
18
19 m4_define(empathy_version, empathy_full_version[]empathy_maybe_datestamp)
20
21
22 AC_INIT([Empathy],
23         [empathy_version],
24         [http://bugzilla.gnome.org/browse.cgi?product=empathy],
25         [empathy],
26         [https://live.gnome.org/Empathy])
27
28 AC_PREREQ([2.64])
29 AC_COPYRIGHT([
30   Copyright (C) 2003-2007 Imendio AB
31   Copyright (C) 2007-2010 Collabora Ltd.
32 ])
33
34 # Minimal version required
35
36 # Hardp deps
37 FOLKS_REQUIRED=0.6.6
38 GNUTLS_REQUIRED=2.8.5
39
40 GLIB_REQUIRED=2.32.0
41 AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_30, [Ignore post 2.30 deprecations])
42 AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_32, [Prevent post 2.32 APIs])
43
44 GTK_REQUIRED=3.3.6
45 AC_DEFINE(GDK_VERSION_MIN_REQUIRED, GDK_VERSION_3_4, [Ignore post 3.4 deprecations])
46 AC_DEFINE(GDK_VERSION_MAX_ALLOWED, GDK_VERSION_3_4, [Prevent post 3.4 APIs])
47
48 CLUTTER_REQUIRED=1.10.0
49 AC_DEFINE(CLUTTER_VERSION_MIN_REQUIRED, CLUTTER_VERSION_1_8, [Ignore post 1.8 deprecations])
50 AC_DEFINE(CLUTTER_VERSION_MAX_ALLOWED, CLUTTER_VERSION_1_10, [Prevent post 1.10 APIs])
51
52 CLUTTER_GTK_REQUIRED=0.90.3
53 CLUTTER_GST_REQUIRED=1.5.2
54
55 GSTREAMER_REQUIRED=0.10.32
56 KEYRING_REQUIRED=2.26.0
57 GCR_REQUIRED=2.91.4
58 LIBCANBERRA_GTK_REQUIRED=0.25
59 LIBNOTIFY_REQUIRED=0.7.0
60 TELEPATHY_FARSTREAM_REQUIRED=0.2.1
61 TELEPATHY_GLIB_REQUIRED=0.17.6
62 TELEPATHY_LOGGER=0.2.13
63 WEBKIT_REQUIRED=1.3.13
64 GOA_REQUIRED=3.5.1
65
66 # Optional deps
67 ENCHANT_REQUIRED=1.2.0
68 GEOCLUE_REQUIRED=0.12
69 ISO_CODES_REQUIRED=0.35
70 NAUTILUS_SENDTO_REQUIRED=2.90.0
71 NETWORK_MANAGER_REQUIRED=0.7.0
72 CHAMPLAIN_REQUIRED=0.12.1
73
74 # Use --enable-maintainer-mode to disable deprecated symbols,
75 # disable single include and enable GSEAL. If this is not a released empathy,
76 # maintainer mode is forced
77 # FIXME: don't disable deprecated symbols until bgo #636654 has been fixed
78 #ifelse(empathy_released, 1, [], [enable_maintainer_mode="yes"])
79 #GNOME_MAINTAINER_MODE_DEFINES
80
81 AC_CONFIG_MACRO_DIR([m4])
82 AC_CONFIG_HEADERS([config.h])
83 AC_CONFIG_SRCDIR([configure.ac])
84 AC_CONFIG_AUX_DIR(.)
85
86 AM_INIT_AUTOMAKE([1.11 no-define -Wno-portability tar-ustar no-dist-gzip dist-xz])
87
88 # Support silent build rules. Disable
89 # by either passing --disable-silent-rules to configure or passing V=1
90 # to make
91 AM_SILENT_RULES([yes])
92
93 # Check for programs
94 AC_PROG_CC
95 AC_HEADER_STDC
96 AM_PROG_MKDIR_P
97 AM_PATH_GLIB_2_0
98 AC_PATH_XTRA
99
100 # Initialize libtool
101 LT_PREREQ([2.2])
102 LT_INIT
103
104 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
105 GLIB_GSETTINGS
106 GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
107 AC_SUBST(GLIB_GENMARSHAL)
108
109 AC_CHECK_PROGS([XSLTPROC], [xsltproc])
110 if test -z "$XSLTPROC"; then
111   AC_MSG_ERROR([xsltproc (from libxslt) is required])
112 fi
113 AM_PATH_PYTHON([2.3])
114
115 EMPATHY_ARG_VALGRIND
116
117
118 # -----------------------------------------------------------
119 # Error flags
120 # -----------------------------------------------------------
121 AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
122 AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
123
124 AC_ARG_ENABLE(Werror,
125   AS_HELP_STRING([--disable-Werror],
126                  [compile without -Werror (normally enabled in development builds)]),
127     werror=$enableval, :)
128
129 AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
130 AS_COMPILER_FLAG(-Wno-missing-field-initializers,
131         wno_missing_field_initializers=yes,
132         wno_missing_field_initializers=no)
133 AS_COMPILER_FLAG(-Wno-unused-parameter,
134         wno_unused_parameter=yes,
135         wno_unused_parameter=no)
136
137 ifelse(empathy_released, 1, [],
138     [
139         if test x$werror = xyes; then
140             ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
141         fi
142         if test x$wextra = xyes -a \
143             x$wno_missing_field_initializers = xyes -a \
144             x$wno_unused_parameter = xyes; then
145             ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
146         fi
147     ])
148
149 AS_COMPILER_FLAG(-Wdeclaration-after-statement, ERROR_CFLAGS="$ERROR_CFLAGS -Wdeclaration-after-statement")
150 AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
151 AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
152 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
153 AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
154
155 AC_SUBST(ERROR_CFLAGS)
156
157 AC_ARG_ENABLE(gprof,
158             AS_HELP_STRING([--enable-gprof=@<:@no/yes@:>@],
159             [build with support for gprof]),,
160             [enable_gprof=no])
161 if test "x$enable_gprof" != "xno" ; then
162     CFLAGS="$CFLAGS -pg"
163     LDFLAGS="$LDFLAGS -pg"
164 fi
165
166 AC_SUBST(LDFLAGS)
167
168 # -----------------------------------------------------------
169 # Pkg-Config dependency checks
170 # -----------------------------------------------------------
171
172 AC_CHECK_LIBM
173 AC_SUBST(LIBM)
174
175 PKG_CHECK_MODULES(EMPATHY,
176 [
177    dbus-glib-1
178    folks >= $FOLKS_REQUIRED
179    folks-telepathy >= $FOLKS_REQUIRED
180    glib-2.0 >= $GLIB_REQUIRED
181    gio-2.0 >= $GLIB_REQUIRED
182    gio-unix-2.0 >= $GLIB_REQUIRED
183    gnome-keyring-1 >= $KEYRING_REQUIRED
184    gnutls >= $GNUTLS_REQUIRED
185    gmodule-export-2.0
186    gobject-2.0
187    gsettings-desktop-schemas
188    gstreamer-0.10 >= $GSTREAMER_REQUIRED
189    gstreamer-interfaces-0.10
190    libxml-2.0
191    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
192    telepathy-logger-0.2 >= $TELEPATHY_LOGGER
193    x11
194    gtk+-3.0 >= $GTK_REQUIRED
195    libcanberra-gtk3 >= $LIBCANBERRA_GTK_REQUIRED
196    libnotify >= $LIBNOTIFY_REQUIRED
197    gcr-3 >= $GCR_REQUIRED
198    libpulse
199    libpulse-mainloop-glib
200    webkitgtk-3.0 >= $WEBKIT_REQUIRED
201    libsoup-2.4
202 ])
203
204 PKG_CHECK_MODULES(EMPATHY_CALL,
205 [
206    farstream-0.1
207    telepathy-farstream >= $TELEPATHY_FARSTREAM_REQUIRED
208    clutter-1.0 >= $CLUTTER_REQUIRED
209    clutter-gtk-1.0 >= $CLUTTER_GTK_REQUIRED
210    clutter-gst-1.0 >= $CLUTTER_GST_REQUIRED
211 ])
212
213 AC_DEFINE(EMPATHY_GOA_PROVIDER, "org.gnome.OnlineAccounts",
214    [Name of provider for accounts imported from GOA])
215
216 # -----------------------------------------------------------
217 # evolution-data-server (about-me)
218 # -----------------------------------------------------------
219 AC_ARG_WITH(eds,
220             AS_HELP_STRING([--with-eds],
221                            [build with evolution-data-server support]),,
222             [with_eds=yes])
223 if test x"$with_eds" = x"yes" ; then
224    PKG_CHECK_MODULES(EDS, [libebook-1.2])
225    AC_DEFINE(HAVE_EDS, 1, [Define if we have libebook])
226 fi
227
228 # -----------------------------------------------------------
229 # Enable debug
230 # -----------------------------------------------------------
231
232 AC_ARG_ENABLE(debug,
233   AS_HELP_STRING([--disable-debug],
234                  [compile without debug code]),
235     enable_debug=$enableval, enable_debug=yes )
236
237 if test x$enable_debug = xyes; then
238   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
239 fi
240
241 # -----------------------------------------------------------
242 # Language Support
243 # -----------------------------------------------------------
244 IT_PROG_INTLTOOL([0.50.0])
245
246 GETTEXT_PACKAGE=empathy
247 AC_SUBST(GETTEXT_PACKAGE)
248 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
249
250 # -----------------------------------------------------------
251 # gudev
252 # -----------------------------------------------------------
253 AC_ARG_ENABLE(gudev,
254               AS_HELP_STRING([--enable-gudev=@<:@no/yes/auto@:>@],
255                              [build with gudev support]), ,
256                              enable_gudev=auto)
257
258 if test "x$enable_gudev" != "xno"; then
259
260    PKG_CHECK_MODULES(UDEV, [gudev-1.0],
261         have_gudev="yes", have_gudev="no")
262
263    if test "x$have_gudev" = "xyes"; then
264       AC_DEFINE(HAVE_UDEV, 1, [Define if you have gudev])
265    fi
266 else
267    have_gudev=no
268 fi
269
270 if test "x$enable_gudev" = "xyes" -a "x$have_gudev" != "xyes"; then
271    AC_MSG_ERROR([Could not find gudev dependencies:
272
273 $UDEV_PKG_ERRORS])
274 fi
275 AM_CONDITIONAL(HAVE_UDEV, test "x$have_gudev" = "xyes")
276
277 # -----------------------------------------------------------
278 # spellchecking checks: enchant and iso-codes
279 # -----------------------------------------------------------
280 AC_ARG_ENABLE(spell,
281               AS_HELP_STRING([--enable-spell=@<:@no/yes/auto@:>@],
282                              [Enable spell checking]), ,
283                              enable_spell=auto)
284
285 if test "x$enable_spell" != "xno"; then
286    PKG_CHECK_MODULES(ENCHANT,
287    [
288       enchant >= $ENCHANT_REQUIRED,
289       iso-codes >= $ISO_CODES_REQUIRED
290    ], have_enchant="yes", have_enchant="no")
291
292    if test "x$have_enchant" = "xyes"; then
293       AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
294       if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
295          $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
296             AC_DEFINE_UNQUOTED(ISO_CODES_PREFIX, ["`$PKG_CONFIG --variable=prefix iso-codes`"], [ISO codes prefix])
297             AC_DEFINE(HAVE_ENCHANT, [], [Define if you have libenchant])
298             result=yes
299       else
300             result=no
301             have_enchant="no"
302       fi
303       AC_MSG_RESULT([$result])
304    fi
305 else
306    have_enchant=no
307 fi
308
309 if test "x$enable_spell" = "xyes" -a "x$have_enchant" != "xyes"; then
310    AC_MSG_ERROR([Could not find spell-checking dependencies:
311
312 $ENCHANT_PKG_ERRORS])
313 fi
314
315 AM_CONDITIONAL(HAVE_ENCHANT, test "x$have_enchant" = "xyes")
316
317 # -----------------------------------------------------------
318 # Map view checks: libchamplain
319 # -----------------------------------------------------------
320 AC_ARG_ENABLE(map,
321               AS_HELP_STRING([--enable-map=@<:@no/yes/auto@:>@],
322                              [Enable map view]), ,
323                              enable_map=auto)
324
325 if test "x$enable_map" != "xno"; then
326
327    PKG_CHECK_MODULES(LIBCHAMPLAIN,
328     [
329        clutter-gtk-1.0
330        champlain-gtk-0.12
331        champlain-0.12 >= $CHAMPLAIN_REQUIRED
332     ], have_libchamplain="yes", have_libchamplain="no")
333
334    if test "x$have_libchamplain" = "xyes"; then
335       AC_DEFINE(HAVE_LIBCHAMPLAIN, 1, [Define if you have libchamplain])
336    fi
337 else
338    have_libchamplain=no
339 fi
340
341 if test "x$enable_map" = "xyes" -a "x$have_libchamplain" != "xyes"; then
342    AC_MSG_ERROR([Could not find map view dependencies:
343
344 $LIBCHAMPLAIN_PKG_ERRORS])
345 fi
346
347 AM_CONDITIONAL(HAVE_LIBCHAMPLAIN, test "x$have_libchamplain" = "xyes")
348
349 # -----------------------------------------------------------
350 # location checks: geoclue
351 # -----------------------------------------------------------
352 AC_ARG_ENABLE(location,
353               AS_HELP_STRING([--enable-location=@<:@no/yes/auto@:>@],
354                              [Enable location awareness]), ,
355                              enable_location=auto)
356
357 if test "x$enable_location" != "xno"; then
358    PKG_CHECK_MODULES(GEOCLUE,
359    [
360       geoclue >= $GEOCLUE_REQUIRED
361    ], have_geoclue="yes", have_geoclue="no")
362
363    if test "x$have_geoclue" = "xyes"; then
364       AC_DEFINE(HAVE_GEOCLUE, 1, [Define if you have geoclue])
365    fi
366 else
367    have_geoclue="no"
368 fi
369
370 if test "x$enable_location" = "xyes" -a "x$have_geoclue" != "xyes"; then
371    AC_MSG_ERROR([Could not find location dependencies:
372
373 $GEOCLUE_PKG_ERRORS])
374 fi
375
376 AM_CONDITIONAL(HAVE_GEOCLUE, test "x$have_geoclue" = "xyes")
377 AC_SUBST(GEOCLUE_CFLAGS)
378 AC_SUBST(GEOCLUE_LIBS)
379
380 # -----------------------------------------------------------
381 # location checks: geocode-glib
382 # -----------------------------------------------------------
383 AC_ARG_ENABLE(geocode,
384               AS_HELP_STRING([--enable-geocode=@<:@no/yes/auto@:>@],
385                              [Enable geocode support]), ,
386                              enable_geocode=auto)
387
388 if test "x$enable_geocode" != "xno"; then
389    PKG_CHECK_MODULES(GEOCODE,
390    [
391       geocode-glib
392    ], have_geocode="yes", have_geocode="no")
393
394    if test "x$have_geocode" = "xyes"; then
395       AC_DEFINE(HAVE_GEOCODE, 1, [Define if you have geocode])
396    fi
397 else
398    have_geocode="no"
399 fi
400
401 if test "x$enable_geocode" = "xyes" -a "x$have_geocode" != "xyes"; then
402    AC_MSG_ERROR([Could not find geocode dependencies:
403
404 $GEOCODE_PKG_ERRORS])
405 fi
406
407 AM_CONDITIONAL(HAVE_GEOCODE, test "x$have_geocode" = "xyes")
408 AC_SUBST(GEOCODE_CFLAGS)
409 AC_SUBST(GEOCODE_LIBS)
410
411 # -----------------------------------------------------------
412 # nautilus-sendto
413 # -----------------------------------------------------------
414 AC_ARG_ENABLE(nautilus-sendto,
415               AS_HELP_STRING([--enable-nautilus-sendto=@<:@no/yes/auto@:>@],
416                              [build nautilus-sendto plugin]), ,
417                              enable_nautilus_sendto=auto)
418
419 if test "x$enable_nautilus_sendto" != "xno"; then
420    PKG_CHECK_MODULES(NST,
421     [
422        nautilus-sendto >= $NAUTILUS_SENDTO_REQUIRED
423     ], have_nst="yes", have_nst="no")
424 else
425    have_nst=no
426 fi
427
428 if test "x$enable_nautilus_sendto" = "xyes" -a "x$have_nst" != "xyes"; then
429    AC_MSG_ERROR([Could not find nautilus-sendto dependencies:
430
431 $NST_PKG_ERRORS])
432 fi
433
434 AM_CONDITIONAL(HAVE_NST, test "x$have_nst" = "xyes")
435
436 # -----------------------------------------------------------
437 # goa-mc-plugin
438 # -----------------------------------------------------------
439 AC_ARG_ENABLE(goa,
440               AS_HELP_STRING([--enable-goa=@<:@no/yes/auto@:>@],
441                              [build GOA MC plugin]), ,
442                              enable_goa=auto)
443
444 if test "x$enable_goa" != "xno"; then
445    PKG_CHECK_MODULES(GOA,
446     [
447        mission-control-plugins
448        goa-1.0 >= $GOA_REQUIRED
449     ], have_goa="yes", have_goa="no")
450
451    AC_MSG_CHECKING([Mission Control plugins dir])
452    MISSION_CONTROL_PLUGINS_DIR=`pkg-config --variable=plugindir mission-control-plugins`
453
454    AC_MSG_RESULT([$MISSION_CONTROL_PLUGINS_DIR])
455    AC_SUBST(MISSION_CONTROL_PLUGINS_DIR)
456 else
457    have_goa=no
458 fi
459
460 if test "x$enable_goa" = "xyes" -a "x$have_goa" != "xyes"; then
461    AC_MSG_ERROR([Could not find GOA dependencies.])
462 fi
463
464 if test "x$have_goa" = "xyes"; then
465    AC_DEFINE(HAVE_GOA, 1, [Define to 1 to enable GNOME Online Accounts])
466 fi
467
468 AM_CONDITIONAL(HAVE_GOA, test "x$have_goa" = "xyes")
469
470 # Optional dependency for avatar selection
471 AC_ARG_WITH([cheese],
472             AS_HELP_STRING([--with-cheese],
473                            [enable cheese webcam support]),,
474             with_cheese=auto)
475
476 if test x"$with_cheese" != x"no" ; then
477    PKG_CHECK_MODULES(CHEESE, gstreamer-0.10 cheese-gtk >= 2.91.91.1, [have_cheese=yes], [have_cheese=no])
478    if test x${have_cheese} = xyes; then
479      AC_DEFINE(HAVE_CHEESE, 1, [Define to 1 to enable cheese webcam support])
480    fi
481    if test x${with_cheese} = xyes && test x${have_cheese} = xno; then
482      AC_MSG_ERROR([Cheese configured but not found:
483
484 $CHEESE_PKG_ERRORS])
485    fi
486 else
487    have_cheese=no
488 fi
489 AM_CONDITIONAL(BUILD_CHEESE, test x${have_cheese} = xyes)
490
491 # Help documentation
492 YELP_HELP_INIT
493
494 # -----------------------------------------------------------
495 # Coding style checks
496 # -----------------------------------------------------------
497 AC_ARG_ENABLE(coding-style-checks,
498   AS_HELP_STRING([--disable-coding-style-checks],
499                  [do not check coding style using grep]),
500     [ENABLE_CODING_STYLE_CHECKS=$enableval],
501     [ENABLE_CODING_STYLE_CHECKS=yes])
502
503 AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
504 # -----------------------------------------------------------
505
506 AC_CONFIG_FILES([
507    Makefile
508    data/Makefile
509    data/empathy.desktop.in
510    data/empathy-accounts.desktop.in
511    data/icons/Makefile
512    extensions/Makefile
513    po/Makefile.in
514    libempathy/Makefile
515    libempathy-gtk/Makefile
516    src/Makefile
517    nautilus-sendto-plugin/Makefile
518    goa-mc-plugin/Makefile
519    help/Makefile
520    tests/Makefile
521    tests/interactive/Makefile
522    tests/xml/Makefile
523    tests/certificates/Makefile
524    tools/Makefile
525 ])
526 AC_OUTPUT
527
528 echo "
529 Configure summary:
530
531         Compiler....................:  ${CC}
532         Compiler Flags..............:  ${CFLAGS} ${ERROR_CFLAGS}
533         Linker Flags................:  ${LDFLAGS}
534         Prefix......................:  ${prefix}
535         Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
536
537     Features:
538         Spell checking (enchant)....:  ${have_enchant}
539         Display maps (libchamplain).:  ${have_libchamplain}
540         Location awareness (Geoclue):  ${have_geoclue}
541         Geocode support (Geocode)...:  ${have_geocode}
542         Cheese webcam support ......:  ${have_cheese}
543         Camera monitoring...........:  ${have_gudev}
544
545     Extras:
546         Nautilus-sendto plugin......:  ${have_nst}
547         GOA MC plugin...............:  ${have_goa}
548         Salut E-D-S support.........:  ${with_eds}
549 "