]> git.0d.be Git - empathy.git/blob - configure.ac
copy error flags from Gabble
[empathy.git] / configure.ac
1 # Making releases:
2 #   set the new version number:
3 #     odd minor -> development series
4 #     even minor -> stable series
5 #     increment micro for each release within a series
6 #   set empathy_nano_version to 0.
7
8 m4_define([empathy_major_version], [2])
9 m4_define([empathy_minor_version], [29])
10 m4_define([empathy_micro_version], [1])
11 m4_define([empathy_nano_version], [1])
12
13 m4_define([empathy_base_version],
14           [empathy_major_version.empathy_minor_version.empathy_micro_version])
15 m4_define([empathy_version],
16           [m4_if(empathy_nano_version, 0, [empathy_base_version],
17               [empathy_base_version].[empathy_nano_version])])
18
19 AC_INIT(Empathy, empathy_version, http://bugzilla.gnome.org/browse.cgi?product=empathy)
20
21
22 AC_PREREQ(2.59)
23 AC_COPYRIGHT([
24   Copyright (C) 2003-2007 Imendio AB
25   Copyright (C) 2007-2008 Collabora Ltd.
26 ])
27
28 # Minimal version required
29 GLIB_REQUIRED=2.22.0
30 GTK_REQUIRED=2.16.0
31 GCONF_REQUIRED=1.2.0
32 LIBPANELAPPLET_REQUIRED=2.10.0
33 TELEPATHY_GLIB_REQUIRED=0.7.35
34 ENCHANT_REQUIRED=1.2.0
35 ISO_CODES_REQUIRED=0.35
36 LIBNOTIFY_REQUIRED=0.4.4
37 LIBCANBERRA_GTK_REQUIRED=0.4
38 LIBCHAMPLAIN_REQUIRED=0.4
39 LIBCHAMPLAIN_GTK_REQUIRED=0.4
40 CLUTTER_GTK_REQUIRED=0.10
41 GEOCLUE_REQUIRED=0.11
42 WEBKIT_REQUIRED=1.1.15
43 KEYRING_REQUIRED=2.22
44 NETWORK_MANAGER_REQUIRED=0.7.0
45 NAUTILUS_SENDTO_REQUIRED=2.28.0.1
46
47 # Use --enable-maintainer-mode to disabled deprecated symbols
48 GNOME_MAINTAINER_MODE_DEFINES
49
50 # Uncomment that to build with single include disabled
51 #AC_DEFINE(G_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GLib])
52 #AC_DEFINE(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GDK pixbuf])
53 #AC_DEFINE(GTK_DISABLE_SINGLE_INCLUDES, [], [Disable single includes for GTK])
54
55 AC_CONFIG_MACRO_DIR([m4])
56 AC_CONFIG_HEADERS([config.h])
57 AC_CONFIG_SRCDIR([configure.ac])
58 AC_CONFIG_AUX_DIR(.)
59
60 GNOME_COMMON_INIT
61
62 AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define -Wno-portability)
63 AC_ISC_POSIX
64 AC_PROG_CC
65 AC_HEADER_STDC
66 AM_PROG_LIBTOOL
67 AM_PROG_MKDIR_P
68 AM_PATH_GLIB_2_0
69 AC_PATH_XTRA
70 IT_PROG_INTLTOOL([0.35.0])
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 # -----------------------------------------------------------
89 # Error flags
90 # -----------------------------------------------------------
91 AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="")
92 AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
93
94 AC_ARG_ENABLE(Werror,
95   AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
96     werror=$enableval, :)
97
98 AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
99 AS_COMPILER_FLAG(-Wno-missing-field-initializers,
100         wno_missing_field_initializers=yes,
101         wno_missing_field_initializers=no)
102 AS_COMPILER_FLAG(-Wno-unused-parameter,
103         wno_unused_parameter=yes,
104         wno_unused_parameter=no)
105
106 ifelse(empathy_nano_version, 0, [],
107     [
108         if test x$werror = xyes; then
109             ERROR_CFLAGS="$ERROR_CFLAGS -Werror"
110         fi
111         if test x$wextra = xyes -a \
112             x$wno_missing_field_initializers = xyes -a \
113             x$wno_unused_parameter = xyes; then
114             ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter"
115         fi
116     ])
117
118 AS_COMPILER_FLAG(-Wdeclaration-after-statement, ERROR_CFLAGS="$ERROR_CFLAGS -Wdeclaration-after-statement")
119 AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow")
120 AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
121 AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
122 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
123
124 AC_SUBST(ERROR_CFLAGS)
125
126 # -----------------------------------------------------------
127 # Pkg-Config dependency checks
128 # -----------------------------------------------------------
129
130 PKG_CHECK_MODULES(LIBEMPATHY,
131 [
132    glib-2.0 >= $GLIB_REQUIRED
133    gobject-2.0
134    gio-2.0 >= $GLIB_REQUIRED
135    gio-unix-2.0 >= $GLIB_REQUIRED
136    libxml-2.0
137    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
138    telepathy-farsight
139    farsight2-0.10
140    gstreamer-0.10
141 ])
142
143 PKG_CHECK_MODULES(LIBEMPATHYGTK,
144 [
145    glib-2.0 >= $GLIB_REQUIRED
146    gobject-2.0
147    gio-2.0 >= $GLIB_REQUIRED
148    gconf-2.0 >= $GCONF_REQUIRED
149    x11
150    gtk+-2.0 >= $GTK_REQUIRED
151    libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED
152    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
153    farsight2-0.10
154    gstreamer-0.10
155    gstreamer-interfaces-0.10
156 ])
157
158 PKG_CHECK_MODULES(EMPATHY,
159 [
160    glib-2.0 >= $GLIB_REQUIRED
161    gobject-2.0
162    gio-2.0 >= $GLIB_REQUIRED
163    gdk-x11-2.0
164    gtk+-2.0 >= $GTK_REQUIRED
165    libebook-1.2
166    dbus-glib-1
167    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
168    telepathy-farsight
169    gstreamer-0.10
170    unique-1.0
171    gnome-keyring-1 >= $KEYRING_REQUIRED
172 ])
173
174 PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
175
176 # -----------------------------------------------------------
177 # Enable debug
178 # -----------------------------------------------------------
179
180 AC_ARG_ENABLE(debug,
181   AC_HELP_STRING([--disable-debug],[compile without debug code]),
182     enable_debug=$enableval, enable_debug=yes )
183
184 if test x$enable_debug = xyes; then
185   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
186 fi
187
188 # -----------------------------------------------------------
189 # Language Support
190 # -----------------------------------------------------------
191
192 GETTEXT_PACKAGE=empathy
193 AC_SUBST(GETTEXT_PACKAGE)
194 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
195
196 AM_GLIB_GNU_GETTEXT
197
198 # -----------------------------------------------------------
199 # Connectivity integration
200 # -----------------------------------------------------------
201 AC_ARG_WITH(connectivity,
202               AS_HELP_STRING([--with-connectivity=@<:@nm/connman/auto/no@:>@],
203                              [build with connectivity support]), ,
204                              with_connectivity=auto)
205
206 if test "x$with_connectivity" = "xno"; then
207    have_nm=no
208    have_connman=no
209
210 elif test "x$with_connectivity" = "xconnman"; then
211
212    PKG_CHECK_MODULES(CONNMAN,
213    [
214       dbus-glib-1
215    ], have_connman="yes", have_connman="no")
216
217    if test "x$have_connman" = "xyes"; then
218       AC_DEFINE(HAVE_CONNMAN, 1, [Define if you have connman dependencies])
219       have_nm=no
220    fi
221
222 else
223
224    PKG_CHECK_MODULES(NETWORK_MANAGER,
225    [
226       libnm_glib >= $NETWORK_MANAGER_REQUIRED
227    ], have_nm="yes", have_nm="no")
228
229    if test "x$have_nm" = "xyes"; then
230       AC_DEFINE(HAVE_NM, 1, [Define if you have libnm-glib])
231       have_connman=no
232    fi
233 fi
234
235 if test "x$with_connectivity" = "xconnman" -a "x$have_connman" != "xyes"; then
236    AC_MSG_ERROR([Couldn't find connman dependencies.])
237 fi
238
239 if test "x$with_connectivity" = "xnm" -a "x$have_nm" != "xyes"; then
240    AC_MSG_ERROR([Couldn't find libnm-glib dependencies.])
241 fi
242
243 AM_CONDITIONAL(HAVE_NM, test "x$have_nm" = "xyes")
244 AM_CONDITIONAL(HAVE_CONNMAN, test "x$have_connman" = "xyes")
245
246 # -----------------------------------------------------------
247 # Webkit
248 # -----------------------------------------------------------
249 AC_ARG_ENABLE(webkit,
250               AS_HELP_STRING([--enable-webkit=@<:@no/yes/auto@:>@],
251                              [build with webkit support]), ,
252                              enable_webkit=auto)
253
254 if test "x$enable_webkit" != "xno"; then
255    PKG_CHECK_MODULES(WEBKIT,
256    [
257       webkit-1.0 >= $WEBKIT_REQUIRED
258    ], have_webkit="yes", have_webkit="no")
259
260    if test "x$have_webkit" = "xyes"; then
261       AC_DEFINE(HAVE_WEBKIT, 1, [Define if you have libwebkitgtk])
262    fi
263 else
264    have_webkit=no
265 fi
266
267 if test "x$enable_webkit" = "xyes" -a "x$have_webkit" != "xyes"; then
268    AC_MSG_ERROR([Couldn't find webkit dependencies.])
269 fi
270 AM_CONDITIONAL(HAVE_WEBKIT, test "x$have_webkit" = "xyes")
271
272 # -----------------------------------------------------------
273 # spellchecking checks: enchant and iso-codes
274 # -----------------------------------------------------------
275 AC_ARG_ENABLE(spell,
276               AS_HELP_STRING([--enable-spell=@<:@no/yes/auto@:>@],
277                              [Enable spell checking]), ,
278                              enable_spell=auto)
279
280 if test "x$enable_spell" != "xno"; then
281    PKG_CHECK_MODULES(ENCHANT,
282    [
283       enchant >= $ENCHANT_REQUIRED,
284       iso-codes >= $ISO_CODES_REQUIRED
285    ], have_enchant="yes", have_enchant="no")
286
287    if test "x$have_enchant" = "xyes"; then
288       AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
289       if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
290          $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
291             AC_DEFINE_UNQUOTED(ISO_CODES_PREFIX, ["`$PKG_CONFIG --variable=prefix iso-codes`"], [ISO codes prefix])
292             AC_DEFINE(HAVE_ENCHANT, [], [Define if you have libenchant])
293             result=yes
294       else
295             result=no
296             have_enchant="no"
297       fi
298       AC_MSG_RESULT([$result])
299    fi
300 else
301    have_enchant=no
302 fi
303
304 if test "x$enable_spell" = "xyes" -a "x$have_enchant" != "xyes"; then
305    AC_MSG_ERROR([Couldn't find spell dependencies.])
306 fi
307
308 AM_CONDITIONAL(HAVE_ENCHANT, test "x$have_enchant" = "xyes")
309
310 # -----------------------------------------------------------
311 # Map view checks: libchamplain
312 # -----------------------------------------------------------
313 AC_ARG_ENABLE(map,
314               AS_HELP_STRING([--enable-map=@<:@no/yes/auto@:>@],
315                              [Enable map view]), ,
316                              enable_map=auto)
317
318 if test "x$enable_map" != "xno"; then
319    PKG_CHECK_MODULES(LIBCHAMPLAIN,
320    [
321       champlain-0.4 >= $LIBCHAMPLAIN_REQUIRED,
322       champlain-gtk-0.4 >= $LIBCHAMPLAIN_GTK_REQUIRED
323       clutter-gtk-0.10 >= $CLUTTER_GTK_REQUIRED
324    ], have_libchamplain="yes", have_libchamplain="no")
325
326    if test "x$have_libchamplain" = "xyes"; then
327       AC_DEFINE(HAVE_LIBCHAMPLAIN, 1, [Define if you have libchamplain])
328    fi
329 else
330    have_libchamplain=no
331 fi
332
333 if test "x$enable_map" = "xyes" -a "x$have_libchamplain" != "xyes"; then
334    AC_MSG_ERROR([Couldn't find map view dependencies.])
335 fi
336
337 AM_CONDITIONAL(HAVE_LIBCHAMPLAIN, test "x$have_libchamplain" = "xyes")
338
339 # -----------------------------------------------------------
340 # location checks: geoclue
341 # -----------------------------------------------------------
342 AC_ARG_ENABLE(location,
343               AS_HELP_STRING([--enable-location=@<:@no/yes/auto@:>@],
344                              [Enable location awareness]), ,
345                              enable_location=auto)
346
347 if test "x$enable_location" != "xno"; then
348    PKG_CHECK_MODULES(GEOCLUE,
349    [
350       geoclue >= $GEOCLUE_REQUIRED
351    ], have_geoclue="yes", have_geoclue="no")
352
353    if test "x$have_geoclue" = "xyes"; then
354       AC_DEFINE(HAVE_GEOCLUE, 1, [Define if you have geoclue])
355    fi
356 else
357    have_geoclue="no"
358 fi
359
360 if test "x$enable_location" = "xyes" -a "x$have_geoclue" != "xyes"; then
361    AC_MSG_ERROR([Couldn't find location dependencies.])
362 fi
363
364 AM_CONDITIONAL(HAVE_GEOCLUE, test "x$have_geoclue" = "xyes")
365 AC_SUBST(GEOCLUE_CFLAGS)
366 AC_SUBST(GEOCLUE_LIBS)
367
368 # -----------------------------------------------------------
369 # moblin widgets support
370 # -----------------------------------------------------------
371 AC_ARG_ENABLE(moblin,
372               AS_HELP_STRING([--enable-moblin=@<:no/yes@:>@],
373                              [Enable moblin widgets]), ,
374                              enable_moblin=no)
375
376 if test "x$enable_moblin" != "xno"; then
377     PKG_CHECK_MODULES(MOBLIN,
378     [
379        nbtk-gtk-1.2
380     ], have_moblin="yes", have_moblin="no")
381
382     if test "x$have_moblin" = "xyes"; then
383        AC_DEFINE(HAVE_MOBLIN, 1, [Define if you have moblin])
384     fi
385 else
386    have_moblin="no"
387 fi
388
389 if test "x$enable_moblin" = "xyes" -a "x$have_moblin" != "xyes"; then
390    AC_MSG_ERROR([Couldn't find moblin dependencies.])
391 fi
392
393 AM_CONDITIONAL(HAVE_MOBLIN, test "x$have_moblin" = "xyes")
394 AC_SUBST(MOBLIN_CFLAGS)
395 AC_SUBST(MOBLIN_LIBS)
396
397 # -----------------------------------------------------------
398 # nautilus-sendto
399 # -----------------------------------------------------------
400 AC_ARG_ENABLE(nautilus-sendto,
401               AS_HELP_STRING([--enable-nautilus-sendto=@<:@no/yes/auto@:>@],
402                              [build nautilus-sendto plugin]), ,
403                              enable_nst=auto)
404
405 if test "x$enable_nst" != "xno"; then
406    PKG_CHECK_MODULES(NST,
407    [
408       nautilus-sendto >= $NAUTILUS_SENDTO_REQUIRED
409    ], have_nst="yes", have_nst="no")
410 else
411    have_nst=no
412 fi
413
414 if test "x$enable_nst" = "xyes" -a "x$have_nst" != "xyes"; then
415    AC_MSG_ERROR([Couldn't find nautilus-sendto dependencies.])
416 fi
417
418 AM_CONDITIONAL(HAVE_NST, test "x$have_nst" = "xyes")
419
420 # -----------------------------------------------------------
421 # Tests
422 # -----------------------------------------------------------
423 AC_ARG_ENABLE(tests,
424               AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@],
425                              [build tests]), ,
426                              enable_tests=auto)
427
428 if test "x$enable_tests" != "xno"; then
429    PKG_CHECK_MODULES(CHECK,
430    [
431       check >= 0.9.4
432    ], have_check="yes", have_check="no")
433 else
434    have_check=no
435 fi
436
437 if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then
438    AC_MSG_ERROR([Couldn't find check dependencies.])
439 fi
440
441 AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes")
442
443 # -----------------------------------------------------------
444 # Coding style checks
445 # -----------------------------------------------------------
446 AC_ARG_ENABLE(coding-style-checks,
447   AC_HELP_STRING([--disable-coding-style-checks],
448                  [don't check coding style using grep]),
449     [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
450
451 AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
452 # -----------------------------------------------------------
453
454 SHAVE_INIT(.)
455
456 AC_OUTPUT([
457    Makefile
458    data/Makefile
459    data/empathy.desktop.in
460    data/icons/Makefile
461    extensions/Makefile
462    po/Makefile.in
463    libempathy/Makefile
464    libempathy-gtk/Makefile
465    src/Makefile
466    nautilus-sendto-plugin/Makefile
467    help/Makefile
468    tests/Makefile
469    tests/xml/Makefile
470    tools/Makefile
471    shave
472    shave-libtool
473 ])
474
475 echo "
476 Configure summary:
477
478         Compiler....................:  ${CC}
479         Compiler Flags..............:  ${CFLAGS} ${ERROR_CFLAGS}
480         Prefix......................:  ${prefix}
481         Shaved build................:  ${enable_shave}
482         Tests.......................:  ${have_check}
483         Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
484
485     Features:
486         Spell checking (enchant)....:  ${have_enchant}
487         Display maps (libchamplain).:  ${have_libchamplain}
488         Location awareness (Geoclue):  ${have_geoclue}
489         Adium themes (Webkit).......:  ${have_webkit}
490         Moblin widgets .............:  ${have_moblin}
491
492     Connectivity:
493         NetworkManager integration..:  ${have_nm}
494         ConnMan integration.........:  ${have_connman}
495
496     Extras:
497         Nautilus-sendto plugin......:  ${have_nst}
498 "