]> 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], [2])
5 m4_define([empathy_minor_version], [31])
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, empathy_version, http://bugzilla.gnome.org/browse.cgi?product=empathy)
23
24
25 AC_PREREQ(2.59)
26 AC_COPYRIGHT([
27   Copyright (C) 2003-2007 Imendio AB
28   Copyright (C) 2007-2008 Collabora Ltd.
29 ])
30
31 # Minimal version required
32 GLIB_REQUIRED=2.25.9
33 GTK_REQUIRED=2.21.2
34 GCONF_REQUIRED=1.2.0
35 TELEPATHY_GLIB_REQUIRED=0.11.7
36 TELEPATHY_LOGGER=0.1.2
37 ENCHANT_REQUIRED=1.2.0
38 ISO_CODES_REQUIRED=0.35
39 LIBNOTIFY_REQUIRED=0.4.4
40 LIBCANBERRA_GTK_REQUIRED=0.4
41 LIBCHAMPLAIN_REQUIRED=0.4
42 LIBCHAMPLAIN_GTK_REQUIRED=0.4
43 CLUTTER_GTK_REQUIRED=0.10
44 GEOCLUE_REQUIRED=0.11
45 WEBKIT_REQUIRED=1.1.15
46 KEYRING_REQUIRED=2.22
47 NETWORK_MANAGER_REQUIRED=0.7.0
48 NAUTILUS_SENDTO_REQUIRED=2.28.1
49 UNIQUE_REQUIRED=1.1.2
50
51 # Use --enable-maintainer-mode to disable deprecated symbols,
52 # disable single include and enable GSEAL. If this is not a released empathy,
53 # maintainer mode is forced
54 ifelse(empathy_released, 1, [], [enable_maintainer_mode="yes"])
55 GNOME_MAINTAINER_MODE_DEFINES
56 if test $USE_MAINTAINER_MODE = yes; then
57   AC_DEFINE(GSEAL_ENABLE, [], [Seal public structs to force usage of accessors])
58 fi
59
60 AC_CONFIG_MACRO_DIR([m4])
61 AC_CONFIG_HEADERS([config.h])
62 AC_CONFIG_SRCDIR([configure.ac])
63 AC_CONFIG_AUX_DIR(.)
64
65 GNOME_COMMON_INIT
66
67 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define -Wno-portability)
68
69 # Support silent build rules, requires at least automake-1.11. Disable
70 # by either passing --disable-silent-rules to configure or passing V=1
71 # to make
72 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
73
74 AC_ISC_POSIX
75 AC_PROG_CC
76 AC_HEADER_STDC
77 AM_PROG_LIBTOOL
78 AM_PROG_MKDIR_P
79 AM_PATH_GLIB_2_0
80 AC_PATH_XTRA
81 IT_PROG_INTLTOOL([0.35.0])
82 GNOME_DOC_INIT([0.17.3])
83 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
84 GLIB_GSETTINGS
85 GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
86 AC_SUBST(GLIB_GENMARSHAL)
87 CONTROL_CENTER_EXTENSIONDIR=`$PKG_CONFIG --variable=extensiondir libgnome-control-center-extension`
88 AC_SUBST(CONTROL_CENTER_EXTENSIONDIR)
89
90 AC_CHECK_PROGS([XSLTPROC], [xsltproc])
91 if test -z "$XSLTPROC"; then
92   AC_MSG_ERROR([xsltproc (from libxslt) is required])
93 fi
94 AM_PATH_PYTHON([2.3])
95
96 EMPATHY_ARG_VALGRIND
97
98
99 # -----------------------------------------------------------
100 # Error flags
101 # -----------------------------------------------------------
102 AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
103 AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
104
105 AC_ARG_ENABLE(Werror,
106   AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
107     werror=$enableval, :)
108
109 AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
110 AS_COMPILER_FLAG(-Wno-missing-field-initializers,
111         wno_missing_field_initializers=yes,
112         wno_missing_field_initializers=no)
113 AS_COMPILER_FLAG(-Wno-unused-parameter,
114         wno_unused_parameter=yes,
115         wno_unused_parameter=no)
116
117 ifelse(empathy_released, 1, [],
118     [
119         if test x$werror = xyes; then
120             ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
121         fi
122         if test x$wextra = xyes -a \
123             x$wno_missing_field_initializers = xyes -a \
124             x$wno_unused_parameter = xyes; then
125             ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
126         fi
127     ])
128
129 AS_COMPILER_FLAG(-Wdeclaration-after-statement, ERROR_CFLAGS="$ERROR_CFLAGS -Wdeclaration-after-statement")
130 AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
131 AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
132 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
133 # Disabled because some GTK+ headers (like gtkitemfactory.h) are bugged :(
134 #AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
135
136 AC_SUBST(ERROR_CFLAGS)
137
138 # -----------------------------------------------------------
139 # Pkg-Config dependency checks
140 # -----------------------------------------------------------
141
142 PKG_CHECK_MODULES(LIBEMPATHY,
143 [
144    glib-2.0 >= $GLIB_REQUIRED
145    gobject-2.0
146    gio-2.0 >= $GLIB_REQUIRED
147    gio-unix-2.0 >= $GLIB_REQUIRED
148    libxml-2.0
149    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
150    telepathy-farsight
151    farsight2-0.10
152    gstreamer-0.10
153    telepathy-logger-0.1 >= $TELEPATHY_LOGGER
154 ])
155
156 PKG_CHECK_MODULES(LIBEMPATHYGTK,
157 [
158    glib-2.0 >= $GLIB_REQUIRED
159    gobject-2.0
160    gio-2.0 >= $GLIB_REQUIRED
161    gconf-2.0 >= $GCONF_REQUIRED
162    x11
163    gtk+-2.0 >= $GTK_REQUIRED
164    libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED
165    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
166    farsight2-0.10
167    gstreamer-0.10
168    gstreamer-interfaces-0.10
169    telepathy-logger-0.1 >= $TELEPATHY_LOGGER
170 ])
171
172 PKG_CHECK_MODULES(EMPATHY,
173 [
174    glib-2.0 >= $GLIB_REQUIRED
175    gobject-2.0
176    gio-2.0 >= $GLIB_REQUIRED
177    gdk-x11-2.0
178    gtk+-2.0 >= $GTK_REQUIRED
179    libebook-1.2
180    dbus-glib-1
181    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
182    telepathy-farsight
183    farsight2-0.10
184    gstreamer-0.10
185    unique-1.0 >= $UNIQUE_REQUIRED
186    gnome-keyring-1 >= $KEYRING_REQUIRED
187    telepathy-logger-0.1 >= $TELEPATHY_LOGGER
188 ])
189
190 PKG_CHECK_MODULES(LIBEMPATHY_ACCOUNTS_PANEL,
191 [
192    glib-2.0 >= $GLIB_REQUIRED
193    gobject-2.0
194    gio-2.0 >= $GLIB_REQUIRED
195    gdk-x11-2.0
196    gtk+-2.0 >= $GTK_REQUIRED
197    libebook-1.2
198    dbus-glib-1
199    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
200    unique-1.0 >= $UNIQUE_REQUIRED
201    gnome-keyring-1 >= $KEYRING_REQUIRED
202    telepathy-logger-0.1 >= $TELEPATHY_LOGGER
203 ])
204
205 PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
206
207 # -----------------------------------------------------------
208 # Enable debug
209 # -----------------------------------------------------------
210
211 AC_ARG_ENABLE(debug,
212   AC_HELP_STRING([--disable-debug],[compile without debug code]),
213     enable_debug=$enableval, enable_debug=yes )
214
215 if test x$enable_debug = xyes; then
216   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
217 fi
218
219 # -----------------------------------------------------------
220 # Language Support
221 # -----------------------------------------------------------
222
223 GETTEXT_PACKAGE=empathy
224 AC_SUBST(GETTEXT_PACKAGE)
225 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
226
227 AM_GLIB_GNU_GETTEXT
228
229 # -----------------------------------------------------------
230 # Connectivity integration
231 # -----------------------------------------------------------
232 AC_ARG_WITH(connectivity,
233               AS_HELP_STRING([--with-connectivity=@<:@nm/connman/auto/no@:>@],
234                              [build with connectivity support]), ,
235                              with_connectivity=auto)
236
237 if test "x$with_connectivity" = "xno"; then
238    have_nm=no
239    have_connman=no
240
241 elif test "x$with_connectivity" = "xconnman"; then
242
243    PKG_CHECK_MODULES(CONNMAN,
244    [
245       dbus-glib-1
246    ], have_connman="yes", have_connman="no")
247
248    if test "x$have_connman" = "xyes"; then
249       AC_DEFINE(HAVE_CONNMAN, 1, [Define if you have connman dependencies])
250       have_nm=no
251    fi
252
253 else
254
255    PKG_CHECK_MODULES(NETWORK_MANAGER,
256    [
257       libnm_glib >= $NETWORK_MANAGER_REQUIRED
258    ], have_nm="yes", have_nm="no")
259
260    if test "x$have_nm" = "xyes"; then
261       AC_DEFINE(HAVE_NM, 1, [Define if you have libnm-glib])
262       have_connman=no
263    else
264       PKG_CHECK_MODULES(NETWORK_MANAGER,
265       [
266           libnm-glib >= $NETWORK_MANAGER_REQUIRED
267       ], have_nm="yes", have_nm="no")
268
269       if test "x$have_nm" = "xyes"; then
270       AC_DEFINE(HAVE_NM, 1, [Define if you have libnm-glib])
271       have_connman=no
272       fi
273    fi
274 fi
275
276 if test "x$with_connectivity" = "xconnman" -a "x$have_connman" != "xyes"; then
277    AC_MSG_ERROR([Couldn't find connman dependencies.])
278 fi
279
280 if test "x$with_connectivity" = "xnm" -a "x$have_nm" != "xyes"; then
281    AC_MSG_ERROR([Couldn't find libnm-glib dependencies.])
282 fi
283
284 AM_CONDITIONAL(HAVE_NM, test "x$have_nm" = "xyes")
285 AM_CONDITIONAL(HAVE_CONNMAN, test "x$have_connman" = "xyes")
286
287 # -----------------------------------------------------------
288 # Webkit
289 # -----------------------------------------------------------
290 AC_ARG_ENABLE(webkit,
291               AS_HELP_STRING([--enable-webkit=@<:@no/yes/auto@:>@],
292                              [build with webkit support]), ,
293                              enable_webkit=auto)
294
295 if test "x$enable_webkit" != "xno"; then
296    PKG_CHECK_MODULES(WEBKIT,
297    [
298       webkit-1.0 >= $WEBKIT_REQUIRED
299    ], have_webkit="yes", have_webkit="no")
300
301    if test "x$have_webkit" = "xyes"; then
302       AC_DEFINE(HAVE_WEBKIT, 1, [Define if you have libwebkitgtk])
303    fi
304 else
305    have_webkit=no
306 fi
307
308 if test "x$enable_webkit" = "xyes" -a "x$have_webkit" != "xyes"; then
309    AC_MSG_ERROR([Couldn't find webkit dependencies.])
310 fi
311 AM_CONDITIONAL(HAVE_WEBKIT, test "x$have_webkit" = "xyes")
312
313 # -----------------------------------------------------------
314 # spellchecking checks: enchant and iso-codes
315 # -----------------------------------------------------------
316 AC_ARG_ENABLE(spell,
317               AS_HELP_STRING([--enable-spell=@<:@no/yes/auto@:>@],
318                              [Enable spell checking]), ,
319                              enable_spell=auto)
320
321 if test "x$enable_spell" != "xno"; then
322    PKG_CHECK_MODULES(ENCHANT,
323    [
324       enchant >= $ENCHANT_REQUIRED,
325       iso-codes >= $ISO_CODES_REQUIRED
326    ], have_enchant="yes", have_enchant="no")
327
328    if test "x$have_enchant" = "xyes"; then
329       AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
330       if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
331          $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
332             AC_DEFINE_UNQUOTED(ISO_CODES_PREFIX, ["`$PKG_CONFIG --variable=prefix iso-codes`"], [ISO codes prefix])
333             AC_DEFINE(HAVE_ENCHANT, [], [Define if you have libenchant])
334             result=yes
335       else
336             result=no
337             have_enchant="no"
338       fi
339       AC_MSG_RESULT([$result])
340    fi
341 else
342    have_enchant=no
343 fi
344
345 if test "x$enable_spell" = "xyes" -a "x$have_enchant" != "xyes"; then
346    AC_MSG_ERROR([Couldn't find spell dependencies.])
347 fi
348
349 AM_CONDITIONAL(HAVE_ENCHANT, test "x$have_enchant" = "xyes")
350
351 # -----------------------------------------------------------
352 # Map view checks: libchamplain
353 # -----------------------------------------------------------
354 AC_ARG_ENABLE(map,
355               AS_HELP_STRING([--enable-map=@<:@no/yes/auto@:>@],
356                              [Enable map view]), ,
357                              enable_map=auto)
358
359 if test "x$enable_map" != "xno"; then
360    PKG_CHECK_MODULES(LIBCHAMPLAIN,
361    [
362       champlain-0.4 >= $LIBCHAMPLAIN_REQUIRED,
363       champlain-gtk-0.4 >= $LIBCHAMPLAIN_GTK_REQUIRED
364       clutter-gtk-0.10 >= $CLUTTER_GTK_REQUIRED
365    ], have_libchamplain="yes", have_libchamplain="no")
366
367    if test "x$have_libchamplain" = "xyes"; then
368       AC_DEFINE(HAVE_LIBCHAMPLAIN, 1, [Define if you have libchamplain])
369    fi
370 else
371    have_libchamplain=no
372 fi
373
374 if test "x$enable_map" = "xyes" -a "x$have_libchamplain" != "xyes"; then
375    AC_MSG_ERROR([Couldn't find map view dependencies.])
376 fi
377
378 AM_CONDITIONAL(HAVE_LIBCHAMPLAIN, test "x$have_libchamplain" = "xyes")
379
380 # -----------------------------------------------------------
381 # location checks: geoclue
382 # -----------------------------------------------------------
383 AC_ARG_ENABLE(location,
384               AS_HELP_STRING([--enable-location=@<:@no/yes/auto@:>@],
385                              [Enable location awareness]), ,
386                              enable_location=auto)
387
388 if test "x$enable_location" != "xno"; then
389    PKG_CHECK_MODULES(GEOCLUE,
390    [
391       geoclue >= $GEOCLUE_REQUIRED
392    ], have_geoclue="yes", have_geoclue="no")
393
394    if test "x$have_geoclue" = "xyes"; then
395       AC_DEFINE(HAVE_GEOCLUE, 1, [Define if you have geoclue])
396    fi
397 else
398    have_geoclue="no"
399 fi
400
401 if test "x$enable_location" = "xyes" -a "x$have_geoclue" != "xyes"; then
402    AC_MSG_ERROR([Couldn't find location dependencies.])
403 fi
404
405 AM_CONDITIONAL(HAVE_GEOCLUE, test "x$have_geoclue" = "xyes")
406 AC_SUBST(GEOCLUE_CFLAGS)
407 AC_SUBST(GEOCLUE_LIBS)
408
409 # -----------------------------------------------------------
410 # meego widgets support
411 # -----------------------------------------------------------
412 AC_ARG_ENABLE(meego,
413               AS_HELP_STRING([--enable-meego=@<:no/yes@:>@],
414                              [Enable meego widgets]), ,
415                              enable_meego=no)
416
417 if test "x$enable_meego" != "xno"; then
418     PKG_CHECK_MODULES(MEEGO,
419     [
420        mx-gtk-1.0
421     ], have_meego="yes", have_meego="no")
422
423     if test "x$have_meego" = "xyes"; then
424        AC_DEFINE(HAVE_MEEGO, 1, [Define if you have meego])
425     fi
426 else
427    have_meego="no"
428 fi
429
430 if test "x$enable_meego" = "xyes" -a "x$have_meego" != "xyes"; then
431    AC_MSG_ERROR([Couldn't find meego dependencies.])
432 fi
433
434 AM_CONDITIONAL(HAVE_MEEGO, test "x$have_meego" = "xyes")
435 AC_SUBST(MEEGO_CFLAGS)
436 AC_SUBST(MEEGO_LIBS)
437
438 # -----------------------------------------------------------
439 # nautilus-sendto
440 # -----------------------------------------------------------
441 AC_ARG_ENABLE(nautilus-sendto,
442               AS_HELP_STRING([--enable-nautilus-sendto=@<:@no/yes/auto@:>@],
443                              [build nautilus-sendto plugin]), ,
444                              enable_nautilus_sendto=auto)
445
446 if test "x$enable_nautilus_sendto" != "xno"; then
447    PKG_CHECK_MODULES(NST,
448    [
449       nautilus-sendto >= $NAUTILUS_SENDTO_REQUIRED
450    ], have_nst="yes", have_nst="no")
451 else
452    have_nst=no
453 fi
454
455 if test "x$enable_nautilus_sendto" = "xyes" -a "x$have_nst" != "xyes"; then
456    AC_MSG_ERROR([Couldn't find nautilus-sendto dependencies.])
457 fi
458
459 AM_CONDITIONAL(HAVE_NST, test "x$have_nst" = "xyes")
460
461 # -----------------------------------------------------------
462 # new, single-window control center
463 # -----------------------------------------------------------
464 AC_ARG_ENABLE(control_center_embedding,
465               AS_HELP_STRING([--enable-control-center-embedding=@<:@no/yes/auto@:>@],
466                              [Enable support for single-window control center]),
467                              , enable_control_center_embedding=auto)
468
469 if test "x$enable_control_center_embedding" != "xno"; then
470    PKG_CHECK_MODULES(CONTROL_CENTER_EMBEDDING,
471    [
472       libgnome-control-center-extension
473    ], have_control_center_embedding="yes", have_control_center_embedding="no")
474
475    if test "x$have_control_center_embedding" = "xyes"; then
476       AC_DEFINE(HAVE_CONTROL_CENTER_EMBEDDING, 1, [Define if you have the single-window control center])
477    fi
478 else
479    have_control_center_embedding="no"
480 fi
481
482 if test "x$enable_control_center_embedding" = "xyes" -a "x$have_control_center_embedding" != "xyes"; then
483    AC_MSG_ERROR([Couldn't find single-window control center dependencies.])
484 fi
485
486 AM_CONDITIONAL(HAVE_CONTROL_CENTER_EMBEDDING, test "x$have_control_center_embedding" = "xyes")
487 AC_SUBST(CONTROL_CENTER_EMBEDDING_CFLAGS)
488 AC_SUBST(CONTROL_CENTER_EMBEDDING_LIBS)
489
490 # -----------------------------------------------------------
491 # Coding style checks
492 # -----------------------------------------------------------
493 AC_ARG_ENABLE(coding-style-checks,
494   AC_HELP_STRING([--disable-coding-style-checks],
495                  [don't check coding style using grep]),
496     [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
497
498 AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
499 # -----------------------------------------------------------
500
501 AC_OUTPUT([
502    Makefile
503    data/Makefile
504    data/empathy.desktop.in
505    data/empathy-accounts.desktop.in
506    data/icons/Makefile
507    extensions/Makefile
508    po/Makefile.in
509    libempathy/Makefile
510    libempathy-gtk/Makefile
511    src/Makefile
512    nautilus-sendto-plugin/Makefile
513    help/Makefile
514    tests/Makefile
515    tests/interactive/Makefile
516    tests/xml/Makefile
517    tools/Makefile
518 ])
519
520 echo "
521 Configure summary:
522
523         Compiler....................:  ${CC}
524         Compiler Flags..............:  ${CFLAGS} ${ERROR_CFLAGS}
525         Prefix......................:  ${prefix}
526         Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
527
528     Features:
529         Spell checking (enchant)....:  ${have_enchant}
530         Display maps (libchamplain).:  ${have_libchamplain}
531         Location awareness (Geoclue):  ${have_geoclue}
532         Adium themes (Webkit).......:  ${have_webkit}
533         Meego widgets ..............:  ${have_meego}
534         Control center embedding....:  ${have_control_center_embedding}
535
536     Connectivity:
537         NetworkManager integration..:  ${have_nm}
538         ConnMan integration.........:  ${have_connman}
539
540     Extras:
541         Nautilus-sendto plugin......:  ${have_nst}
542 "