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