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