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