]> git.0d.be Git - empathy.git/blob - configure.ac
disable -Wstrict-prototypes as some GTK+ headers are bugged
[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(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes")
121 AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations")
122 # Disabled because some GTK+ headers (like gtkitemfactory.h) are bugged :(
123 #AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes")
124
125 AC_SUBST(ERROR_CFLAGS)
126
127 # -----------------------------------------------------------
128 # Pkg-Config dependency checks
129 # -----------------------------------------------------------
130
131 PKG_CHECK_MODULES(LIBEMPATHY,
132 [
133    glib-2.0 >= $GLIB_REQUIRED
134    gobject-2.0
135    gio-2.0 >= $GLIB_REQUIRED
136    gio-unix-2.0 >= $GLIB_REQUIRED
137    libxml-2.0
138    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
139    telepathy-farsight
140    farsight2-0.10
141    gstreamer-0.10
142 ])
143
144 PKG_CHECK_MODULES(LIBEMPATHYGTK,
145 [
146    glib-2.0 >= $GLIB_REQUIRED
147    gobject-2.0
148    gio-2.0 >= $GLIB_REQUIRED
149    gconf-2.0 >= $GCONF_REQUIRED
150    x11
151    gtk+-2.0 >= $GTK_REQUIRED
152    libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED
153    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
154    farsight2-0.10
155    gstreamer-0.10
156    gstreamer-interfaces-0.10
157 ])
158
159 PKG_CHECK_MODULES(EMPATHY,
160 [
161    glib-2.0 >= $GLIB_REQUIRED
162    gobject-2.0
163    gio-2.0 >= $GLIB_REQUIRED
164    gdk-x11-2.0
165    gtk+-2.0 >= $GTK_REQUIRED
166    libebook-1.2
167    dbus-glib-1
168    telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
169    telepathy-farsight
170    gstreamer-0.10
171    unique-1.0
172    gnome-keyring-1 >= $KEYRING_REQUIRED
173 ])
174
175 PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
176
177 # -----------------------------------------------------------
178 # Enable debug
179 # -----------------------------------------------------------
180
181 AC_ARG_ENABLE(debug,
182   AC_HELP_STRING([--disable-debug],[compile without debug code]),
183     enable_debug=$enableval, enable_debug=yes )
184
185 if test x$enable_debug = xyes; then
186   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
187 fi
188
189 # -----------------------------------------------------------
190 # Language Support
191 # -----------------------------------------------------------
192
193 GETTEXT_PACKAGE=empathy
194 AC_SUBST(GETTEXT_PACKAGE)
195 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
196
197 AM_GLIB_GNU_GETTEXT
198
199 # -----------------------------------------------------------
200 # Connectivity integration
201 # -----------------------------------------------------------
202 AC_ARG_WITH(connectivity,
203               AS_HELP_STRING([--with-connectivity=@<:@nm/connman/auto/no@:>@],
204                              [build with connectivity support]), ,
205                              with_connectivity=auto)
206
207 if test "x$with_connectivity" = "xno"; then
208    have_nm=no
209    have_connman=no
210
211 elif test "x$with_connectivity" = "xconnman"; then
212
213    PKG_CHECK_MODULES(CONNMAN,
214    [
215       dbus-glib-1
216    ], have_connman="yes", have_connman="no")
217
218    if test "x$have_connman" = "xyes"; then
219       AC_DEFINE(HAVE_CONNMAN, 1, [Define if you have connman dependencies])
220       have_nm=no
221    fi
222
223 else
224
225    PKG_CHECK_MODULES(NETWORK_MANAGER,
226    [
227       libnm_glib >= $NETWORK_MANAGER_REQUIRED
228    ], have_nm="yes", have_nm="no")
229
230    if test "x$have_nm" = "xyes"; then
231       AC_DEFINE(HAVE_NM, 1, [Define if you have libnm-glib])
232       have_connman=no
233    fi
234 fi
235
236 if test "x$with_connectivity" = "xconnman" -a "x$have_connman" != "xyes"; then
237    AC_MSG_ERROR([Couldn't find connman dependencies.])
238 fi
239
240 if test "x$with_connectivity" = "xnm" -a "x$have_nm" != "xyes"; then
241    AC_MSG_ERROR([Couldn't find libnm-glib dependencies.])
242 fi
243
244 AM_CONDITIONAL(HAVE_NM, test "x$have_nm" = "xyes")
245 AM_CONDITIONAL(HAVE_CONNMAN, test "x$have_connman" = "xyes")
246
247 # -----------------------------------------------------------
248 # Webkit
249 # -----------------------------------------------------------
250 AC_ARG_ENABLE(webkit,
251               AS_HELP_STRING([--enable-webkit=@<:@no/yes/auto@:>@],
252                              [build with webkit support]), ,
253                              enable_webkit=auto)
254
255 if test "x$enable_webkit" != "xno"; then
256    PKG_CHECK_MODULES(WEBKIT,
257    [
258       webkit-1.0 >= $WEBKIT_REQUIRED
259    ], have_webkit="yes", have_webkit="no")
260
261    if test "x$have_webkit" = "xyes"; then
262       AC_DEFINE(HAVE_WEBKIT, 1, [Define if you have libwebkitgtk])
263    fi
264 else
265    have_webkit=no
266 fi
267
268 if test "x$enable_webkit" = "xyes" -a "x$have_webkit" != "xyes"; then
269    AC_MSG_ERROR([Couldn't find webkit dependencies.])
270 fi
271 AM_CONDITIONAL(HAVE_WEBKIT, test "x$have_webkit" = "xyes")
272
273 # -----------------------------------------------------------
274 # spellchecking checks: enchant and iso-codes
275 # -----------------------------------------------------------
276 AC_ARG_ENABLE(spell,
277               AS_HELP_STRING([--enable-spell=@<:@no/yes/auto@:>@],
278                              [Enable spell checking]), ,
279                              enable_spell=auto)
280
281 if test "x$enable_spell" != "xno"; then
282    PKG_CHECK_MODULES(ENCHANT,
283    [
284       enchant >= $ENCHANT_REQUIRED,
285       iso-codes >= $ISO_CODES_REQUIRED
286    ], have_enchant="yes", have_enchant="no")
287
288    if test "x$have_enchant" = "xyes"; then
289       AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
290       if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
291          $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
292             AC_DEFINE_UNQUOTED(ISO_CODES_PREFIX, ["`$PKG_CONFIG --variable=prefix iso-codes`"], [ISO codes prefix])
293             AC_DEFINE(HAVE_ENCHANT, [], [Define if you have libenchant])
294             result=yes
295       else
296             result=no
297             have_enchant="no"
298       fi
299       AC_MSG_RESULT([$result])
300    fi
301 else
302    have_enchant=no
303 fi
304
305 if test "x$enable_spell" = "xyes" -a "x$have_enchant" != "xyes"; then
306    AC_MSG_ERROR([Couldn't find spell dependencies.])
307 fi
308
309 AM_CONDITIONAL(HAVE_ENCHANT, test "x$have_enchant" = "xyes")
310
311 # -----------------------------------------------------------
312 # Map view checks: libchamplain
313 # -----------------------------------------------------------
314 AC_ARG_ENABLE(map,
315               AS_HELP_STRING([--enable-map=@<:@no/yes/auto@:>@],
316                              [Enable map view]), ,
317                              enable_map=auto)
318
319 if test "x$enable_map" != "xno"; then
320    PKG_CHECK_MODULES(LIBCHAMPLAIN,
321    [
322       champlain-0.4 >= $LIBCHAMPLAIN_REQUIRED,
323       champlain-gtk-0.4 >= $LIBCHAMPLAIN_GTK_REQUIRED
324       clutter-gtk-0.10 >= $CLUTTER_GTK_REQUIRED
325    ], have_libchamplain="yes", have_libchamplain="no")
326
327    if test "x$have_libchamplain" = "xyes"; then
328       AC_DEFINE(HAVE_LIBCHAMPLAIN, 1, [Define if you have libchamplain])
329    fi
330 else
331    have_libchamplain=no
332 fi
333
334 if test "x$enable_map" = "xyes" -a "x$have_libchamplain" != "xyes"; then
335    AC_MSG_ERROR([Couldn't find map view dependencies.])
336 fi
337
338 AM_CONDITIONAL(HAVE_LIBCHAMPLAIN, test "x$have_libchamplain" = "xyes")
339
340 # -----------------------------------------------------------
341 # location checks: geoclue
342 # -----------------------------------------------------------
343 AC_ARG_ENABLE(location,
344               AS_HELP_STRING([--enable-location=@<:@no/yes/auto@:>@],
345                              [Enable location awareness]), ,
346                              enable_location=auto)
347
348 if test "x$enable_location" != "xno"; then
349    PKG_CHECK_MODULES(GEOCLUE,
350    [
351       geoclue >= $GEOCLUE_REQUIRED
352    ], have_geoclue="yes", have_geoclue="no")
353
354    if test "x$have_geoclue" = "xyes"; then
355       AC_DEFINE(HAVE_GEOCLUE, 1, [Define if you have geoclue])
356    fi
357 else
358    have_geoclue="no"
359 fi
360
361 if test "x$enable_location" = "xyes" -a "x$have_geoclue" != "xyes"; then
362    AC_MSG_ERROR([Couldn't find location dependencies.])
363 fi
364
365 AM_CONDITIONAL(HAVE_GEOCLUE, test "x$have_geoclue" = "xyes")
366 AC_SUBST(GEOCLUE_CFLAGS)
367 AC_SUBST(GEOCLUE_LIBS)
368
369 # -----------------------------------------------------------
370 # moblin widgets support
371 # -----------------------------------------------------------
372 AC_ARG_ENABLE(moblin,
373               AS_HELP_STRING([--enable-moblin=@<:no/yes@:>@],
374                              [Enable moblin widgets]), ,
375                              enable_moblin=no)
376
377 if test "x$enable_moblin" != "xno"; then
378     PKG_CHECK_MODULES(MOBLIN,
379     [
380        nbtk-gtk-1.2
381     ], have_moblin="yes", have_moblin="no")
382
383     if test "x$have_moblin" = "xyes"; then
384        AC_DEFINE(HAVE_MOBLIN, 1, [Define if you have moblin])
385     fi
386 else
387    have_moblin="no"
388 fi
389
390 if test "x$enable_moblin" = "xyes" -a "x$have_moblin" != "xyes"; then
391    AC_MSG_ERROR([Couldn't find moblin dependencies.])
392 fi
393
394 AM_CONDITIONAL(HAVE_MOBLIN, test "x$have_moblin" = "xyes")
395 AC_SUBST(MOBLIN_CFLAGS)
396 AC_SUBST(MOBLIN_LIBS)
397
398 # -----------------------------------------------------------
399 # nautilus-sendto
400 # -----------------------------------------------------------
401 AC_ARG_ENABLE(nautilus-sendto,
402               AS_HELP_STRING([--enable-nautilus-sendto=@<:@no/yes/auto@:>@],
403                              [build nautilus-sendto plugin]), ,
404                              enable_nst=auto)
405
406 if test "x$enable_nst" != "xno"; then
407    PKG_CHECK_MODULES(NST,
408    [
409       nautilus-sendto >= $NAUTILUS_SENDTO_REQUIRED
410    ], have_nst="yes", have_nst="no")
411 else
412    have_nst=no
413 fi
414
415 if test "x$enable_nst" = "xyes" -a "x$have_nst" != "xyes"; then
416    AC_MSG_ERROR([Couldn't find nautilus-sendto dependencies.])
417 fi
418
419 AM_CONDITIONAL(HAVE_NST, test "x$have_nst" = "xyes")
420
421 # -----------------------------------------------------------
422 # Tests
423 # -----------------------------------------------------------
424 AC_ARG_ENABLE(tests,
425               AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@],
426                              [build tests]), ,
427                              enable_tests=auto)
428
429 if test "x$enable_tests" != "xno"; then
430    PKG_CHECK_MODULES(CHECK,
431    [
432       check >= 0.9.4
433    ], have_check="yes", have_check="no")
434 else
435    have_check=no
436 fi
437
438 if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then
439    AC_MSG_ERROR([Couldn't find check dependencies.])
440 fi
441
442 AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes")
443
444 # -----------------------------------------------------------
445 # Coding style checks
446 # -----------------------------------------------------------
447 AC_ARG_ENABLE(coding-style-checks,
448   AC_HELP_STRING([--disable-coding-style-checks],
449                  [don't check coding style using grep]),
450     [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
451
452 AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
453 # -----------------------------------------------------------
454
455 SHAVE_INIT(.)
456
457 AC_OUTPUT([
458    Makefile
459    data/Makefile
460    data/empathy.desktop.in
461    data/icons/Makefile
462    extensions/Makefile
463    po/Makefile.in
464    libempathy/Makefile
465    libempathy-gtk/Makefile
466    src/Makefile
467    nautilus-sendto-plugin/Makefile
468    help/Makefile
469    tests/Makefile
470    tests/xml/Makefile
471    tools/Makefile
472    shave
473    shave-libtool
474 ])
475
476 echo "
477 Configure summary:
478
479         Compiler....................:  ${CC}
480         Compiler Flags..............:  ${CFLAGS} ${ERROR_CFLAGS}
481         Prefix......................:  ${prefix}
482         Shaved build................:  ${enable_shave}
483         Tests.......................:  ${have_check}
484         Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
485
486     Features:
487         Spell checking (enchant)....:  ${have_enchant}
488         Display maps (libchamplain).:  ${have_libchamplain}
489         Location awareness (Geoclue):  ${have_geoclue}
490         Adium themes (Webkit).......:  ${have_webkit}
491         Moblin widgets .............:  ${have_moblin}
492
493     Connectivity:
494         NetworkManager integration..:  ${have_nm}
495         ConnMan integration.........:  ${have_connman}
496
497     Extras:
498         Nautilus-sendto plugin......:  ${have_nst}
499 "